Migrate ExcelIO from ClosedXML to NPOI
This commit is contained in:
@@ -1,48 +1,48 @@
|
||||
using ClosedXML.Excel;
|
||||
using JdeScoping.ExcelIO.Tests.Fixtures;
|
||||
using Shouldly;
|
||||
using Xunit;
|
||||
|
||||
namespace JdeScoping.ExcelIO.Tests.Integration;
|
||||
|
||||
public class MinimalSearchTests : IClassFixture<MinimalSearchFixture>
|
||||
{
|
||||
private readonly XLWorkbook _workbook;
|
||||
|
||||
public MinimalSearchTests(MinimalSearchFixture fixture)
|
||||
{
|
||||
_workbook = fixture.Workbook;
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SheetCount_IsTwo()
|
||||
{
|
||||
_workbook.Worksheets.Count.ShouldBe(2);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SearchCriteriaSheet_Exists()
|
||||
{
|
||||
_workbook.Worksheets.TryGetWorksheet("Search Criteria", out _).ShouldBeTrue();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SearchResultsSheet_Exists()
|
||||
{
|
||||
_workbook.Worksheets.TryGetWorksheet("Search Results", out _).ShouldBeTrue();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SearchCriteriaSheet_IsProtected()
|
||||
{
|
||||
var sheet = _workbook.Worksheet("Search Criteria");
|
||||
sheet.Protection.IsProtected.ShouldBeTrue();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SearchResultsSheet_IsProtected()
|
||||
{
|
||||
var sheet = _workbook.Worksheet("Search Results");
|
||||
sheet.Protection.IsProtected.ShouldBeTrue();
|
||||
}
|
||||
}
|
||||
using JdeScoping.ExcelIO.Tests.Fixtures;
|
||||
using NPOI.XSSF.UserModel;
|
||||
using Shouldly;
|
||||
using Xunit;
|
||||
|
||||
namespace JdeScoping.ExcelIO.Tests.Integration;
|
||||
|
||||
public class MinimalSearchTests : IClassFixture<MinimalSearchFixture>
|
||||
{
|
||||
private readonly XSSFWorkbook _workbook;
|
||||
|
||||
public MinimalSearchTests(MinimalSearchFixture fixture)
|
||||
{
|
||||
_workbook = fixture.Workbook;
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SheetCount_IsTwo()
|
||||
{
|
||||
_workbook.NumberOfSheets.ShouldBe(2);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SearchCriteriaSheet_Exists()
|
||||
{
|
||||
_workbook.GetSheet("Search Criteria").ShouldNotBeNull();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SearchResultsSheet_Exists()
|
||||
{
|
||||
_workbook.GetSheet("Search Results").ShouldNotBeNull();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SearchCriteriaSheet_IsProtected()
|
||||
{
|
||||
var sheet = (XSSFSheet)_workbook.GetSheet("Search Criteria")!;
|
||||
sheet.IsSheetLocked.ShouldBeTrue();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SearchResultsSheet_IsProtected()
|
||||
{
|
||||
var sheet = (XSSFSheet)_workbook.GetSheet("Search Results")!;
|
||||
sheet.IsSheetLocked.ShouldBeTrue();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user