38 lines
961 B
C#
38 lines
961 B
C#
using RhSolutions.AddIn;
|
|
using RhSolutions.Tools;
|
|
|
|
namespace RhSolutions.Tests;
|
|
|
|
[ExcelTestSettings(OutOfProcess = true)]
|
|
public class WorkbookValidationTests : IDisposable
|
|
{
|
|
private readonly RhSolutionsAddIn _addIn;
|
|
|
|
public WorkbookValidationTests()
|
|
{
|
|
_addIn = new RhSolutionsAddIn();
|
|
_addIn.AutoOpen();
|
|
Util.Application.Workbooks.Add();
|
|
}
|
|
|
|
[ExcelFact(Workbook = @"TestWorkbooks\EmptyTestTable.xlsx")]
|
|
public void WorksheetIsCorrect()
|
|
{
|
|
Worksheet worksheet = Util.Workbook.Sheets[1];
|
|
Assert.True(worksheet.IsValidSource());
|
|
}
|
|
|
|
[ExcelFact(Workbook = @"TestWorkbooks\EmptyWorkbook.xlsx")]
|
|
public void EmptyWorkbookIsNotCorrect()
|
|
{
|
|
Worksheet worksheet = Util.Workbook.Sheets[1];
|
|
Assert.False(worksheet.IsValidSource());
|
|
}
|
|
|
|
public void Dispose()
|
|
{
|
|
_addIn.AutoClose();
|
|
Util.Application.ActiveWindow.Close(SaveChanges: false);
|
|
}
|
|
}
|