Add RhSolutions formula test

This commit is contained in:
Sergey Chebotar 2023-03-23 07:18:11 +03:00
parent 6497738c2d
commit 2cef4d1d9f
2 changed files with 44 additions and 14 deletions

View File

@ -0,0 +1,30 @@
namespace RhSolutions.Tests;
[ExcelTestSettings(AddIn = @"..\..\..\..\RhSolutions.AddIn\bin\Debug\net6.0-windows\RhSolutions-AddIn")]
public class RhSolutionsCheckTest : IDisposable
{
private Workbook workbook;
public RhSolutionsCheckTest()
{
workbook = Util.Application.Workbooks.Add();
}
[ExcelFact]
public void RhSolutionsFunctionWorks()
{
var ws = workbook.Sheets[1];
ws.Range["A1"].Formula = "=RHSOLUTIONS(\"гильза 16\")";
Util.Application.CalculateFull();
var result = ws.Range["A1"].Value;
Assert.Equal("Загрузка...", result);
}
public void Dispose()
{
Util.Application.ActiveWorkbook.Close(SaveChanges: false);
}
}

View File

@ -1,16 +1,16 @@
namespace RhSolutions.Tests; //namespace RhSolutions.Tests;
[ExcelTestSettings(AddIn = @"..\..\..\..\RhSolutions.AddIn\bin\Debug\net6.0-windows\RhSolutions-AddIn")] //[ExcelTestSettings(AddIn = @"..\..\..\..\RhSolutions.AddIn\bin\Debug\net6.0-windows\RhSolutions-AddIn")]
public class WorkbookCheckTests : IDisposable //public class WorkbookCheckTests : IDisposable
{ //{
[ExcelFact(Workbook = @".\Workbooks\EmptyTestTable.xlsx")] // [ExcelFact(Workbook = @".\Workbooks\EmptyTestTable.xlsx")]
public void WorksheetIsCorrect() // public void WorksheetIsCorrect()
{ // {
Assert.True(true); // Assert.True(true);
} // }
public void Dispose() // public void Dispose()
{ // {
Util.Application.ActiveWorkbook.Close(SaveChanges: false); // Util.Application.ActiveWorkbook.Close(SaveChanges: false);
} // }
} //}