6952f686fa
- Add WorkbookFixtureBase and 4 concrete fixtures for shared workbooks - Add ExcelTestHelpers with shared utility methods - Create Integration/ folder with 7 fixture-based test classes: - MinimalSearchTests (5 tests) - SearchResultsSheetTests (5 tests) - MisInfoSheetTests (11 tests) - InvestigationSheetTests (7 tests) - ProtectionAndStyleTests (7 tests) - LegacyFormatTests (5 tests) - LargeDataSetTests (1 test) - Delete redundant ExcelExportIntegrationTests.cs (26 tests) - Delete redundant LegacyComparisonTests.cs (16 tests) - Reduce workbook generations from ~42 to 4 fixtures - Test runtime reduced from ~18 min to ~4 min (76% improvement) - All 122 ExcelIO tests pass
49 lines
1.2 KiB
C#
49 lines
1.2 KiB
C#
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();
|
|
}
|
|
}
|