aboutsummaryrefslogtreecommitdiff
path: root/RhSolutions.Tests
diff options
context:
space:
mode:
authorSergey Chebotar <s.chebotar@gmail.com>2023-05-16 18:05:35 +0300
committerSergey Chebotar <s.chebotar@gmail.com>2023-05-16 18:05:35 +0300
commitaca468c01596668c382c868102d28e2eb002ff57 (patch)
tree78b5a9f5b1cc15300b70d1adc7ae957aeb1c8acd /RhSolutions.Tests
parentade18e5e4083c5ae464e3a258e063e2310888d3a (diff)
Add Workbook read tests
Diffstat (limited to 'RhSolutions.Tests')
-rw-r--r--RhSolutions.Tests/CanReadProducts.cs13
-rw-r--r--RhSolutions.Tests/RhSolutions.Tests.csproj2
-rw-r--r--RhSolutions.Tests/TestWorkbooks/Specifications/HeatingFloor.xlsxbin10391 -> 0 bytes
-rw-r--r--RhSolutions.Tests/TestWorkbooks/TestSpecificaion.xlsxbin0 -> 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
deleted file mode 100644
index 20416e0..0000000
--- a/RhSolutions.Tests/TestWorkbooks/Specifications/HeatingFloor.xlsx
+++ /dev/null
Binary files differ
diff --git a/RhSolutions.Tests/TestWorkbooks/TestSpecificaion.xlsx b/RhSolutions.Tests/TestWorkbooks/TestSpecificaion.xlsx
new file mode 100644
index 0000000..e9a6441
--- /dev/null
+++ b/RhSolutions.Tests/TestWorkbooks/TestSpecificaion.xlsx
Binary files differ