refactor(ExcelIO): delete old attribute-based infrastructure
- Remove OutputColumnAttribute, OutputTableAttribute, OutputColumnCache - Remove AttributeTableWriter and ColumnFormatter - Remove duplicate ExcelFormats from Mapping (use Formatting version) - Remove OutputColumn model - Add FilterEntryMaps for criteria sheet filter models - Update CriteriaSheetGenerator to use FluentTableWriter - Remove attributes from filter entry models (now use fluent maps) - Update DI to register filter entry maps and remove old services - Update tests to use new fluent infrastructure - Delete obsolete test files for removed infrastructure Task 16 of fluent-excel-mapping-implementation plan.
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
using ClosedXML.Excel;
|
||||
using JdeScoping.ExcelIO.Options;
|
||||
using JdeScoping.ExcelIO.Formatting;
|
||||
using JdeScoping.ExcelIO.Generators;
|
||||
using JdeScoping.ExcelIO.Helpers;
|
||||
using JdeScoping.ExcelIO.Mapping;
|
||||
using JdeScoping.ExcelIO.Mapping.Maps;
|
||||
using JdeScoping.ExcelIO.Models.Reporting;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.Extensions.Options;
|
||||
@@ -10,6 +10,11 @@ using NSubstitute;
|
||||
using Shouldly;
|
||||
using Xunit;
|
||||
|
||||
using ExcelFormats = JdeScoping.ExcelIO.Formatting.ExcelFormats;
|
||||
using SearchResult = JdeScoping.Core.Models.SearchResults.SearchResult;
|
||||
using MisSearchResult = JdeScoping.Core.Models.SearchResults.MisSearchResult;
|
||||
using MisNonMatchSearchResult = JdeScoping.Core.Models.SearchResults.MisNonMatchSearchResult;
|
||||
|
||||
namespace JdeScoping.ExcelIO.Tests;
|
||||
|
||||
/// <summary>
|
||||
@@ -30,11 +35,33 @@ public class LegacyComparisonTests
|
||||
DataSheetPassword = "JDESCOPINGTOOL"
|
||||
});
|
||||
|
||||
var cache = new OutputColumnCache();
|
||||
var tableWriter = new AttributeTableWriter(cache);
|
||||
var registry = CreateTestRegistry();
|
||||
var tableWriter = new FluentTableWriter(registry);
|
||||
var criteriaGenerator = new CriteriaSheetGenerator(options, tableWriter);
|
||||
|
||||
_service = new ExcelExportService(logger, options, criteriaGenerator, tableWriter);
|
||||
_service = new ExcelExportService(logger, options, criteriaGenerator, tableWriter, registry);
|
||||
}
|
||||
|
||||
private static ExcelMapRegistry CreateTestRegistry()
|
||||
{
|
||||
var registry = new ExcelMapRegistry();
|
||||
|
||||
// Search result maps
|
||||
registry.Register(new SearchResultMap());
|
||||
registry.Register(new MisSearchResultMap());
|
||||
registry.Register(new MisNonMatchSearchResultMap());
|
||||
|
||||
// Filter entry maps
|
||||
registry.Register(new TimespanFilterMap());
|
||||
registry.Register(new WorkOrderFilterEntryMap());
|
||||
registry.Register(new ItemNumberFilterEntryMap());
|
||||
registry.Register(new ProfitCenterFilterEntryMap());
|
||||
registry.Register(new WorkCenterFilterEntryMap());
|
||||
registry.Register(new OperatorFilterEntryMap());
|
||||
registry.Register(new ComponentLotFilterEntryMap());
|
||||
registry.Register(new ItemOperationMisFilterEntryMap());
|
||||
|
||||
return registry;
|
||||
}
|
||||
|
||||
#region Search Results Column Order Tests
|
||||
|
||||
Reference in New Issue
Block a user