Add Workbook read tests

This commit is contained in:
Sergey Chebotar 2023-05-16 18:05:35 +03:00
parent ade18e5e40
commit aca468c015
4 changed files with 9 additions and 6 deletions

View File

@ -45,14 +45,17 @@ public class CanReadProducts : IDisposable
Assert.Equal(3, products.Count());
}
[ExcelFact(Workbook = @"TestWorkbooks\Specifications\HeatingFloor.xlsx")]
[ExcelFact(Workbook = @"TestWorkbooks\TestSpecificaion.xlsx")]
public void CanReadWorkbook()
{
Worksheet worksheet = Util.Workbook.Worksheets[1];
var products = _reader.ReadProducts(new[] { worksheet });
Assert.NotNull(products);
Assert.NotEmpty(products);
var result = _reader.ReadProducts(new[] { worksheet });
Assert.NotNull(result);
Assert.NotEmpty(result);
Assert.Equal("TestSpecificaion", result.First().Item1);
var products = result.First().Item2;
Assert.Equal(46, products.Count());
Assert.Equal(29266, products.Sum(p => p.Value));
}
public void Dispose()

View File

@ -27,7 +27,7 @@
<None Update="TestWorkbooks\ExcelTableTest.xlsx">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="TestWorkbooks\Specifications\HeatingFloor.xlsx">
<None Update="TestWorkbooks\TestSpecificaion.xlsx">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>

Binary file not shown.