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());
|
Assert.Equal(3, products.Count());
|
||||||
}
|
}
|
||||||
|
|
||||||
[ExcelFact(Workbook = @"TestWorkbooks\Specifications\HeatingFloor.xlsx")]
|
[ExcelFact(Workbook = @"TestWorkbooks\TestSpecificaion.xlsx")]
|
||||||
public void CanReadWorkbook()
|
public void CanReadWorkbook()
|
||||||
{
|
{
|
||||||
Worksheet worksheet = Util.Workbook.Worksheets[1];
|
Worksheet worksheet = Util.Workbook.Worksheets[1];
|
||||||
var products = _reader.ReadProducts(new[] { worksheet });
|
var result = _reader.ReadProducts(new[] { worksheet });
|
||||||
|
Assert.NotNull(result);
|
||||||
Assert.NotNull(products);
|
Assert.NotEmpty(result);
|
||||||
Assert.NotEmpty(products);
|
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()
|
public void Dispose()
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
<None Update="TestWorkbooks\ExcelTableTest.xlsx">
|
<None Update="TestWorkbooks\ExcelTableTest.xlsx">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</None>
|
</None>
|
||||||
<None Update="TestWorkbooks\Specifications\HeatingFloor.xlsx">
|
<None Update="TestWorkbooks\TestSpecificaion.xlsx">
|
||||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
</None>
|
</None>
|
||||||
</ItemGroup>
|
</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