RhSolutions-AddIn/RhSolutions.Tests/WorkbookValidationTests.cs

29 lines
766 B
C#
Raw Normal View History

2023-03-24 06:22:40 +03:00
namespace RhSolutions.Tests;
[ExcelTestSettings(OutOfProcess = true)]
2023-03-31 15:27:31 +03:00
public class WorkbookValidationTests : IDisposable
2023-03-23 07:18:11 +03:00
{
2023-03-31 15:27:31 +03:00
public WorkbookValidationTests()
2023-03-23 07:18:11 +03:00
{
2023-03-24 06:22:40 +03:00
Util.Application.Workbooks.Add();
}
2023-03-23 07:18:11 +03:00
2023-03-24 06:22:40 +03:00
[ExcelFact(Workbook = @"TestWorkbooks\EmptyTestTable.xlsx")]
public void WorksheetIsCorrect()
{
2023-03-31 15:27:31 +03:00
Worksheet worksheet = Util.Workbook.Sheets[1];
2023-03-24 06:22:40 +03:00
Assert.True(worksheet.IsRehauSource());
}
2023-03-23 07:18:11 +03:00
2023-03-24 06:22:40 +03:00
[ExcelFact(Workbook = @"TestWorkbooks\EmptyWorkbook.xlsx")]
public void EmptyWorkbookIsNotCorrect()
{
Worksheet worksheet = Util.Workbook.Sheets[1];
Assert.False(worksheet.IsRehauSource());
}
2023-03-23 07:18:11 +03:00
2023-03-24 06:22:40 +03:00
public void Dispose()
{
2023-03-31 15:27:31 +03:00
Util.Application.ActiveWindow.Close(SaveChanges: false);
2023-03-23 07:18:11 +03:00
}
2023-03-31 15:27:31 +03:00
}