Add Replaced Writing Test
This commit is contained in:
parent
d4ef078b9d
commit
de73af8b7d
@ -67,7 +67,24 @@ public class CanWriteProducts : IDisposable
|
||||
Assert.Contains("15555551555", targetSheet.Range["C4"].Value2);
|
||||
}
|
||||
|
||||
[ExcelFact(Workbook = @"..\..\..\TestWorkbooks\TestSpecificationReplaced.xlsx")]
|
||||
public void CanWriteReplaced()
|
||||
{
|
||||
Worksheet sourceSheet = Util.Workbook.Worksheets[1];
|
||||
RhSolutionsAddIn.Configuration.SetPriceListPath(Path.GetFullPath(@"..\..\..\TestWorkbooks\TargetSpecificationReplaced.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("TestSpecificationReplaced", products.First().Item1);
|
||||
Assert.Equal("TargetSpecificationReplaced", targetProducts.First().Item1);
|
||||
Assert.Single(targetProducts.First().Item2);
|
||||
var product = targetProducts.First().Item2.First().Key;
|
||||
Assert.Contains("Молот Тора", product.Name);
|
||||
Assert.Contains("15555551555", product.Name);
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
|
BIN
RhSolutions.Tests/TestWorkbooks/TargetSpecificationReplaced.xlsx
Normal file
BIN
RhSolutions.Tests/TestWorkbooks/TargetSpecificationReplaced.xlsx
Normal file
Binary file not shown.
BIN
RhSolutions.Tests/TestWorkbooks/TestSpecificationReplaced.xlsx
Normal file
BIN
RhSolutions.Tests/TestWorkbooks/TestSpecificationReplaced.xlsx
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user