Billing: Rename attributeVariants and contracts to vaributes

This commit is contained in:
2024-01-27 11:08:10 +01:00
parent 31b0ae245d
commit dd568b81e8
10 changed files with 81 additions and 81 deletions

View File

@ -8,7 +8,7 @@ namespace Tests.HelperTests {
public class BillingDataTest {
private static readonly JsonSerializerOptions JsonOpts = new() { WriteIndented = true };
private static readonly string[] AttributeVariants = ["GV", "GVD", "GVK", "GVS", "GVZ", "WR", "WRS", "ZW", "ZWS", "ZWZ"];
private static readonly string[] Vaributes = ["GV", "GVD", "GVK", "GVS", "GVZ", "WR", "WRS", "ZW", "ZWS", "ZWZ"];
[OneTimeSetUp]
public async Task SetupBilling() {
@ -52,7 +52,7 @@ namespace Tests.HelperTests {
"payment": 0.5,
"curves": []
}
""", AttributeVariants);
""", Vaributes);
Assert.Multiple(() => {
TestCalcOe(data, "GV", 73, 0.5m);
TestCalcOe(data, "WRS", 74, 0.5m);
@ -77,7 +77,7 @@ namespace Tests.HelperTests {
"geb": 0.10
}]
}
""", AttributeVariants);
""", Vaributes);
Assert.Multiple(() => {
TestCalcOe(data, "GV", 70, 0.25m);
TestCalcOe(data, "GV", 72, 0.25m);
@ -114,7 +114,7 @@ namespace Tests.HelperTests {
}
}]
}
""", AttributeVariants);
""", Vaributes);
Assert.Multiple(() => {
TestCalcKmw(data, "GV", 13.00, 0.10m);
TestCalcKmw(data, "GV", 13.50, 0.10m);
@ -148,7 +148,7 @@ namespace Tests.HelperTests {
},
"curves": []
}
""", AttributeVariants);
""", Vaributes);
Assert.Multiple(() => {
TestCalcOe(data, "WR", 73, 0.10m);
TestCalcOe(data, "WRS", 73, 0.15m);
@ -179,7 +179,7 @@ namespace Tests.HelperTests {
},
"curves": []
}
""", AttributeVariants);
""", Vaributes);
Assert.Multiple(() => {
TestCalcOe(data, "GV", 75, 0.30m, qualid: "WEI");
TestCalcOe(data, "ZW", 76, 0.25m, qualid: "WEI");
@ -221,7 +221,7 @@ namespace Tests.HelperTests {
}
}]
}
""", AttributeVariants);
""", Vaributes);
Assert.Multiple(() => {
TestCalcKmw(data, "GV", 15.0, 2.0m);
TestCalcKmw(data, "GV", 15.5, 2.272727m);
@ -281,7 +281,7 @@ namespace Tests.HelperTests {
}
}]
}
""", AttributeVariants);
""", Vaributes);
Assert.Multiple(() => {
TestCalcKmw(data, "GV", 15.0, 0.75m);
TestCalcKmw(data, "GVS", 15.0, 0.50m);
@ -340,7 +340,7 @@ namespace Tests.HelperTests {
}
}]
}
""", AttributeVariants);
""", Vaributes);
Assert.Multiple(() => {
TestCalcOe(data, "GVK", 73, 0.032m);
TestCalcOe(data, "ZWS", 74, 0.033m);
@ -349,11 +349,11 @@ namespace Tests.HelperTests {
});
}
private static List<ContractSelection> GetSelection(IEnumerable<string> attVars) {
private static List<Varibute> GetSelection(IEnumerable<string> attVars) {
return attVars.Select(s => {
var sortid = s[..2];
var attrid = s.Length > 2 ? s[2..] : null;
return new ContractSelection(
return new Varibute(
new WineVar(sortid, sortid),
attrid == null ? null : new WineAttr(attrid, attrid)
);