Edit Guess Reader test

This commit is contained in:
Sergey Chebotar 2023-05-30 08:47:16 +03:00
parent ab217c9052
commit 656f565152
2 changed files with 5 additions and 3 deletions

View File

@ -8,13 +8,15 @@ namespace RhSolutions.Tests;
public class CanDoGuess : IDisposable public class CanDoGuess : IDisposable
{ {
private RhSolutionsAddIn _addIn; private RhSolutionsAddIn _addIn;
private IReader _guessReader;
private IReader _reader; private IReader _reader;
public CanDoGuess() public CanDoGuess()
{ {
_addIn = new(); _addIn = new();
_addIn.AutoOpen(); _addIn.AutoOpen();
_reader = new GuessReader(Util.Application); _guessReader = new GuessReader(Util.Application);
_reader = new ExcelReader(Util.Application, RhSolutionsAddIn.Configuration);
} }
[ExcelFact(Workbook = @"..\..\..\TestWorkbooks\TestSpecificationGuess.xlsx")] [ExcelFact(Workbook = @"..\..\..\TestWorkbooks\TestSpecificationGuess.xlsx")]
@ -22,7 +24,7 @@ public class CanDoGuess : IDisposable
{ {
Worksheet sourceSheet = Util.Workbook.Worksheets[1]; Worksheet sourceSheet = Util.Workbook.Worksheets[1];
RhSolutionsAddIn.Configuration.SetPriceListPath(Path.GetFullPath(@"..\..\..\TestWorkbooks\TargetSpecificationGuess.xlsx")); RhSolutionsAddIn.Configuration.SetPriceListPath(Path.GetFullPath(@"..\..\..\TestWorkbooks\TargetSpecificationGuess.xlsx"));
var products = _reader.ReadProducts(new[] { sourceSheet }); var products = _guessReader.ReadProducts(new[] { sourceSheet });
var _writer = new ExcelWriter(Util.Application, RhSolutionsAddIn.Configuration); var _writer = new ExcelWriter(Util.Application, RhSolutionsAddIn.Configuration);
_writer.WriteProducts(products); _writer.WriteProducts(products);
Worksheet targetSheet = Util.Application.ActiveWindow.ActiveSheet; Worksheet targetSheet = Util.Application.ActiveWindow.ActiveSheet;
@ -39,7 +41,7 @@ public class CanDoGuess : IDisposable
{ {
Worksheet sourceSheet = Util.Workbook.Worksheets[1]; Worksheet sourceSheet = Util.Workbook.Worksheets[1];
RhSolutionsAddIn.Configuration.SetPriceListPath(Path.GetFullPath(@"..\..\..\TestWorkbooks\TargetSpecificationGuessOneRow.xlsx")); RhSolutionsAddIn.Configuration.SetPriceListPath(Path.GetFullPath(@"..\..\..\TestWorkbooks\TargetSpecificationGuessOneRow.xlsx"));
var products = _reader.ReadProducts(new[] { sourceSheet }); var products = _guessReader.ReadProducts(new[] { sourceSheet });
var _writer = new ExcelWriter(Util.Application, RhSolutionsAddIn.Configuration); var _writer = new ExcelWriter(Util.Application, RhSolutionsAddIn.Configuration);
_writer.WriteProducts(products); _writer.WriteProducts(products);
Worksheet targetSheet = Util.Application.ActiveWindow.ActiveSheet; Worksheet targetSheet = Util.Application.ActiveWindow.ActiveSheet;