Add school dress rules tab in Management with tests.

This commit is contained in:
Leonid Pershin
2026-08-20 06:20:06 +03:00
parent c541156614
commit aab0c00988
13 changed files with 724 additions and 15 deletions
@@ -46,6 +46,17 @@ public class AppropriatenessTests
Assert.True(Appropriateness.SkirtLengthFits(context, catalog.Things["ShortSkirt"]));
}
[Fact]
public void WhiteTopBlackBottom_RejectsWrongTopOrBottom()
{
var catalog = LoadCatalog();
var rules = new DressRulePair(FormPolicies.Regular, ColorPolicies.WhiteTopBlackBottom);
Assert.False(Appropriateness.ColorAllowed(catalog, rules, catalog.Things["Shirt"], "Gray"));
Assert.True(Appropriateness.ColorAllowed(catalog, rules, catalog.Things["Shirt"], "White"));
Assert.False(Appropriateness.ColorAllowed(catalog, rules, catalog.Things["Jeans"], "Blue"));
Assert.True(Appropriateness.ColorAllowed(catalog, rules, catalog.Things["Jeans"], "Black"));
}
private static DefCatalog LoadCatalog()
{
var root = Path.Combine(AppContext.BaseDirectory, "vanilla");