aboutsummaryrefslogtreecommitdiff
path: root/RhSolutions.Tests
diff options
context:
space:
mode:
authorSergey Chebotar <s.chebotar@gmail.com>2023-05-21 15:13:17 +0300
committerSergey Chebotar <s.chebotar@gmail.com>2023-05-21 15:13:17 +0300
commitd4ef078b9db6e54d74effcee77f787bf86dabd4c (patch)
tree7d047e35109afd661be6d42256701523281fde23 /RhSolutions.Tests
parentfbb36fb00d4a962326dcf5035ad519bf8c0224b9 (diff)
Add Not Found Writing Test
Diffstat (limited to 'RhSolutions.Tests')
-rw-r--r--RhSolutions.Tests/CanWriteProducts.cs18
-rw-r--r--RhSolutions.Tests/TestWorkbooks/TargetSpecificationNotFound.xlsxbin0 -> 9371 bytes
-rw-r--r--RhSolutions.Tests/TestWorkbooks/TestSpecificationNotFound.xlsxbin0 -> 9177 bytes
3 files changed, 18 insertions, 0 deletions
diff --git a/RhSolutions.Tests/CanWriteProducts.cs b/RhSolutions.Tests/CanWriteProducts.cs
index accb639..9280d5f 100644
--- a/RhSolutions.Tests/CanWriteProducts.cs
+++ b/RhSolutions.Tests/CanWriteProducts.cs
@@ -51,6 +51,24 @@ public class CanWriteProducts : IDisposable
Assert.True(Enumerable.SequenceEqual(products.First().Item2, targetProducts.First().Item2));
}
+
+ [ExcelFact(Workbook = @"..\..\..\TestWorkbooks\TestSpecificationNotFound.xlsx")]
+ public void CanWriteNotFound()
+ {
+ Worksheet sourceSheet = Util.Workbook.Worksheets[1];
+ RhSolutionsAddIn.Configuration.SetPriceListPath(Path.GetFullPath(@"..\..\..\TestWorkbooks\TargetSpecificationNotFound.xlsx"));
+ var products = _reader.ReadProducts(new[] { sourceSheet });
+ var _writer = new ExcelWriter(Util.Application, RhSolutionsAddIn.Configuration);
+ _writer.WriteProducts(products);
+ Worksheet targetSheet = Util.Application.ActiveWindow.ActiveSheet;
+
+ Assert.Equal("???", targetSheet.Range["B4"].Value2);
+ Assert.Contains("Молот Тора", targetSheet.Range["C4"].Value2);
+ Assert.Contains("15555551555", targetSheet.Range["C4"].Value2);
+ }
+
+
+
public void Dispose()
{
_addIn.AutoClose();
diff --git a/RhSolutions.Tests/TestWorkbooks/TargetSpecificationNotFound.xlsx b/RhSolutions.Tests/TestWorkbooks/TargetSpecificationNotFound.xlsx
new file mode 100644
index 0000000..e26fe55
--- /dev/null
+++ b/RhSolutions.Tests/TestWorkbooks/TargetSpecificationNotFound.xlsx
Binary files differ
diff --git a/RhSolutions.Tests/TestWorkbooks/TestSpecificationNotFound.xlsx b/RhSolutions.Tests/TestWorkbooks/TestSpecificationNotFound.xlsx
new file mode 100644
index 0000000..de111f3
--- /dev/null
+++ b/RhSolutions.Tests/TestWorkbooks/TestSpecificationNotFound.xlsx
Binary files differ