File tree Expand file tree Collapse file tree 1 file changed +7
-19
lines changed
Expand file tree Collapse file tree 1 file changed +7
-19
lines changed Original file line number Diff line number Diff line change @@ -68,30 +68,18 @@ public Task VerifyExcelStream()
6868
6969#### Verify a ExcelDataReader
7070
71- <!-- snippet2: VerifyExcelDataReader -->
72- <a id =' snippet-VerifyWorkbook ' ></a >
71+ <!-- snippet: ExcelDataReader -->
72+ <a id =' snippet-ExcelDataReader ' ></a >
7373``` cs
7474[Test ]
75- public Task VerifyWorkbook ()
75+ public Task VerifyExcelDataReader ()
7676{
77- var book = new Workbook
78- {
79- BuiltInDocumentProperties =
80- {
81- Comments = " the comments"
82- }
83- };
84- book .CustomDocumentProperties .Add (" key" , " value" );
85-
86- var sheet = book .Worksheets .Add (" New Sheet" );
87-
88- var cells = sheet .Cells ;
89-
90- cells [0 , 0 ].PutValue (" Some Text" );
91- return Verify (book );
77+ var stream = File .OpenRead (" sample.xlsx" );
78+ using var reader = ExcelDataReader .Create (stream , ExcelWorkbookType .ExcelXml );
79+ return Verify (reader );
9280}
9381```
94- <sup ><a href =' /src/Tests/Samples.cs#L93-L115 ' title =' Snippet source file ' >snippet source</a > | <a href =' #snippet-VerifyWorkbook ' title =' Start of snippet ' >anchor</a ></sup >
82+ <sup ><a href =' /src/Tests/Samples.cs#L15-L25 ' title =' Snippet source file ' >snippet source</a > | <a href =' #snippet-ExcelDataReader ' title =' Start of snippet ' >anchor</a ></sup >
9583<!-- endSnippet -->
9684
9785<!-- snippet: Samples.VerifyExcel#Sheet1.verified.csv -->
You can’t perform that action at this time.
0 commit comments