Migrate ExcelIO from ClosedXML to NPOI

This commit is contained in:
Joseph Doherty
2026-02-06 17:27:09 -05:00
parent 070d915b12
commit dd18a05408
26 changed files with 3034 additions and 2805 deletions
@@ -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();
}
}