The SaveAsync taking a stream is failing because the Workbook.Save is…
… closing the created memory stream before it can copy the data into the users passed in stream. Adding a memory stream overriding close will fix this issue.
Codecov Report
Merging #125 (5f460d7) into master (756dc26) will decrease coverage by
0.12%. The diff coverage is83.33%.
@@ Coverage Diff @@
## master #125 +/- ##
==========================================
- Coverage 93.79% 93.67% -0.13%
==========================================
Files 9 9
Lines 1193 1201 +8
Branches 171 172 +1
==========================================
+ Hits 1119 1125 +6
- Misses 47 48 +1
- Partials 27 28 +1
| Impacted Files | Coverage Δ | |
|---|---|---|
| ExcelMapper/ExcelMapper.cs | 94.55% <83.33%> (-0.21%) |
:arrow_down: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing dataPowered by Codecov. Last update 756dc26...5f460d7. Read the comment docs.
Tests are failing because the implemented non-closing stream is not being closed in any tests.
I can't repro the failure. The MemoryStream's buffer is still available after it is closed. See this answer at StackOverflow: https://stackoverflow.com/a/3981274/1970064
The way I was able to repro it was to attempt to write the stream to an excel file. The excel file would be created; however, the worksheet was blank. When debugging I noticed that the stream had already been closed.
Can you post a code snippet that shows the issue?