Add Workbook read tests
This commit is contained in:
parent
ade18e5e40
commit
aca468c015
@ -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()
|
||||
|
@ -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.
BIN
RhSolutions.Tests/TestWorkbooks/TestSpecificaion.xlsx
Normal file
BIN
RhSolutions.Tests/TestWorkbooks/TestSpecificaion.xlsx
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user