diff options
author | Sergey Chebotar <s.chebotar@gmail.com> | 2023-05-16 18:05:35 +0300 |
---|---|---|
committer | Sergey Chebotar <s.chebotar@gmail.com> | 2023-05-16 18:05:35 +0300 |
commit | aca468c01596668c382c868102d28e2eb002ff57 (patch) | |
tree | 78b5a9f5b1cc15300b70d1adc7ae957aeb1c8acd /RhSolutions.Tests | |
parent | ade18e5e4083c5ae464e3a258e063e2310888d3a (diff) |
Add Workbook read tests
Diffstat (limited to 'RhSolutions.Tests')
-rw-r--r-- | RhSolutions.Tests/CanReadProducts.cs | 13 | ||||
-rw-r--r-- | RhSolutions.Tests/RhSolutions.Tests.csproj | 2 | ||||
-rw-r--r-- | RhSolutions.Tests/TestWorkbooks/Specifications/HeatingFloor.xlsx | bin | 10391 -> 0 bytes | |||
-rw-r--r-- | RhSolutions.Tests/TestWorkbooks/TestSpecificaion.xlsx | bin | 0 -> 11742 bytes |
4 files changed, 9 insertions, 6 deletions
diff --git a/RhSolutions.Tests/CanReadProducts.cs b/RhSolutions.Tests/CanReadProducts.cs index 1fa7357..df0ce73 100644 --- a/RhSolutions.Tests/CanReadProducts.cs +++ b/RhSolutions.Tests/CanReadProducts.cs @@ -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() diff --git a/RhSolutions.Tests/RhSolutions.Tests.csproj b/RhSolutions.Tests/RhSolutions.Tests.csproj index 63b9ae5..c1a28e0 100644 --- a/RhSolutions.Tests/RhSolutions.Tests.csproj +++ b/RhSolutions.Tests/RhSolutions.Tests.csproj @@ -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> diff --git a/RhSolutions.Tests/TestWorkbooks/Specifications/HeatingFloor.xlsx b/RhSolutions.Tests/TestWorkbooks/Specifications/HeatingFloor.xlsx Binary files differdeleted file mode 100644 index 20416e0..0000000 --- a/RhSolutions.Tests/TestWorkbooks/Specifications/HeatingFloor.xlsx +++ /dev/null diff --git a/RhSolutions.Tests/TestWorkbooks/TestSpecificaion.xlsx b/RhSolutions.Tests/TestWorkbooks/TestSpecificaion.xlsx Binary files differnew file mode 100644 index 0000000..e9a6441 --- /dev/null +++ b/RhSolutions.Tests/TestWorkbooks/TestSpecificaion.xlsx |