unittests

This commit is contained in:
2026-04-16 09:45:10 +02:00
parent a25e5900c7
commit ca91af9682
10 changed files with 996 additions and 3 deletions
@@ -0,0 +1,28 @@
using TrafagSalesExporter.Services;
namespace TrafagSalesExporter.Tests;
public class TransformationCatalogTests
{
[Fact]
public void Catalog_Returns_Value_And_Record_Strategies()
{
ITransformationStrategy[] valueStrategies =
[
new CopyTransformationStrategy(),
new ConstantTransformationStrategy()
];
IRecordTransformationStrategy[] recordStrategies =
[
new FirstNonEmptyRecordTransformationStrategy()
];
var catalog = new TransformationCatalog(valueStrategies, recordStrategies);
var all = catalog.GetAll();
Assert.Contains(all, x => x.RuleScope == "Value" && x.Key == "Copy");
Assert.Contains(all, x => x.RuleScope == "Value" && x.Key == "Constant");
Assert.Contains(all, x => x.RuleScope == "Record" && x.Key == "FirstNonEmpty");
}
}