diff options
author | Sergey Chebotar <s.chebotar@gmail.com> | 2023-05-18 07:23:59 +0300 |
---|---|---|
committer | Sergey Chebotar <s.chebotar@gmail.com> | 2023-05-18 07:23:59 +0300 |
commit | 8902d51c14f2679aa3bf168dc3a02056a1352f57 (patch) | |
tree | 6b1939368be6a900616b0aaa9f82d7008e93df31 /RhSolutions.Tests | |
parent | 5babd30c03e0e5ea61a8aad844d53d833776a9d5 (diff) |
Add asserts to write test
Diffstat (limited to 'RhSolutions.Tests')
-rw-r--r-- | RhSolutions.Tests/CanWriteProducts.cs | 9 | ||||
-rw-r--r-- | RhSolutions.Tests/RhSolutions.Tests.csproj | 2 |
2 files changed, 7 insertions, 4 deletions
diff --git a/RhSolutions.Tests/CanWriteProducts.cs b/RhSolutions.Tests/CanWriteProducts.cs index 433b9cb..3792914 100644 --- a/RhSolutions.Tests/CanWriteProducts.cs +++ b/RhSolutions.Tests/CanWriteProducts.cs @@ -17,18 +17,21 @@ public class CanWriteProducts : IDisposable _reader = RhSolutionsAddIn.ServiceProvider.GetRequiredService<IReader>(); } - [ExcelFact(Workbook = @"TestWorkbooks\TestSpecificaion.xlsx")] - public void CanWrite() + [ExcelFact(Workbook = @"TestWorkbooks\TestSpecification.xlsx")] + public void CanWriteSingle() { Worksheet sourceSheet = Util.Workbook.Worksheets[1]; - RhSolutionsAddIn.Configuration.SetPriceListPath(Path.GetFullPath(@"..\..\..\TestWorkbooks\TargetSpecifictaion.xlsx")); + RhSolutionsAddIn.Configuration.SetPriceListPath(Path.GetFullPath(@"..\..\..\TestWorkbooks\TargetSpecification.xlsx")); var products = _reader.ReadProducts(new[] { sourceSheet }); var _writer = new ExcelWriter(Util.Application, RhSolutionsAddIn.Configuration); _writer.WriteProducts(products); Worksheet targetSheet = Util.Application.ActiveWindow.ActiveSheet; var targetProducts = _reader.ReadProducts(new[] { targetSheet }); + Assert.Equal("TestSpecification", products.First().Item1); + Assert.Equal("TargetSpecification", targetProducts.First().Item1); Assert.Equal(products.First().Item2.Count(), targetProducts.First().Item2.Count()); + Assert.Equal(products.First().Item2.Values.Sum(), targetProducts.First().Item2.Values.Sum()); } public void Dispose() diff --git a/RhSolutions.Tests/RhSolutions.Tests.csproj b/RhSolutions.Tests/RhSolutions.Tests.csproj index c1a28e0..7694a62 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\TestSpecificaion.xlsx"> + <None Update="TestWorkbooks\TestSpecification.xlsx"> <CopyToOutputDirectory>Always</CopyToOutputDirectory> </None> </ItemGroup> |