Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
f7297d313a | |||
80fec4473a | |||
95ccb2627c | |||
20e3e2a76b |
17
CHANGELOG.md
17
CHANGELOG.md
@ -3,6 +3,23 @@ Changelog
|
||||
=========
|
||||
|
||||
|
||||
[v0.13.6][v0.13.6] (2025-01-14) {#v0.13.6}
|
||||
------------------------------------------
|
||||
|
||||
### Behobene Fehler {#0.13.6-bugfixes}
|
||||
|
||||
* In seltenen Fällen konnten im Auszahlungsvariante-Fenster (`ChartWindow`) manche (Sorten-/Attribut-/Bewirtschaftungsart-)Zuordnungen zu Kurven nicht richtig gespeichert werden.
|
||||
Berechnungen basierend auf diesen (evtl. falschen) Zuordnungen wurden immer richtig ausgeführt, eine nachträgliche Überprüfung ist daher möglich. (20e3e2a76b)
|
||||
|
||||
### Sonstiges {#0.13.6-misc}
|
||||
|
||||
* Abhängigkeiten aktualisiert. (95ccb2627c, 80fec4473a)
|
||||
|
||||
[v0.13.6]: https://git.necronda.net/winzer/elwig/releases/tag/v0.13.6
|
||||
|
||||
|
||||
|
||||
|
||||
[v0.13.5][v0.13.5] (2025-01-02) {#v0.13.5}
|
||||
------------------------------------------
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
<UseWPF>true</UseWPF>
|
||||
<PreserveCompilationContext>true</PreserveCompilationContext>
|
||||
<ApplicationIcon>Resources\Images\Elwig.ico</ApplicationIcon>
|
||||
<Version>0.13.5</Version>
|
||||
<Version>0.13.6</Version>
|
||||
<SatelliteResourceLanguages>de-AT</SatelliteResourceLanguages>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<ApplicationManifest>app.manifest</ApplicationManifest>
|
||||
@ -29,17 +29,17 @@
|
||||
<PackageReference Include="LinqKit" Version="1.3.7" />
|
||||
<PackageReference Include="MailKit" Version="4.9.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Razor.Language" Version="6.0.36" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Proxies" Version="9.0.0" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="9.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.Ini" Version="9.0.0" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Proxies" Version="9.0.1" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="9.0.1" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.Ini" Version="9.0.1" />
|
||||
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.2903.40" />
|
||||
<PackageReference Include="NJsonSchema" Version="11.1.0" />
|
||||
<PackageReference Include="PdfiumViewer" Version="2.13.0" />
|
||||
<PackageReference Include="PdfiumViewer.Native.x86_64.no_v8-no_xfa" Version="2018.4.8.256" />
|
||||
<PackageReference Include="RazorLight" Version="2.3.1" />
|
||||
<PackageReference Include="ScottPlot.WPF" Version="5.0.47" />
|
||||
<PackageReference Include="System.IO.Ports" Version="9.0.0" />
|
||||
<PackageReference Include="System.Text.Encoding.CodePages" Version="9.0.0" />
|
||||
<PackageReference Include="ScottPlot.WPF" Version="5.0.53" />
|
||||
<PackageReference Include="System.IO.Ports" Version="9.0.1" />
|
||||
<PackageReference Include="System.Text.Encoding.CodePages" Version="9.0.1" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
@ -299,22 +299,28 @@ namespace Elwig.Helpers.Billing {
|
||||
return (rev1, rev2);
|
||||
}
|
||||
|
||||
protected static void CollapsePaymentData(JsonObject data, IEnumerable<RawVaribute> vaributes, bool useDefault = true) {
|
||||
protected static void CollapsePaymentData(JsonObject data, JsonObject originalData, IEnumerable<RawVaribute> vaributes, bool useDefault = true) {
|
||||
var (rev1, rev2) = GetReverseKeys(data);
|
||||
if (!data.ContainsKey("default")) {
|
||||
foreach (var (v, ks) in rev1) {
|
||||
if ((ks.Count >= vaributes.Count() * 0.5 && useDefault) || ks.Count == vaributes.Count()) {
|
||||
foreach (var k in ks) data.Remove(k);
|
||||
if ((ks.Count > vaributes.Count() * 0.5 && useDefault) || ks.Count == vaributes.Count()) {
|
||||
foreach (var k in ks) {
|
||||
if (!(originalData[$"{k[..2]}/"]?.AsValue().TryGetValue<string>(out var o) ?? false) || o == v)
|
||||
data.Remove(k);
|
||||
}
|
||||
data["default"] = v;
|
||||
CollapsePaymentData(data, vaributes, useDefault);
|
||||
CollapsePaymentData(data, originalData, vaributes, useDefault);
|
||||
return;
|
||||
}
|
||||
}
|
||||
foreach (var (v, ks) in rev2) {
|
||||
if ((ks.Count >= vaributes.Count() * 0.5 && useDefault) || ks.Count == vaributes.Count()) {
|
||||
foreach (var k in ks) data.Remove(k);
|
||||
if ((ks.Count > vaributes.Count() * 0.5 && useDefault) || ks.Count == vaributes.Count()) {
|
||||
foreach (var k in ks) {
|
||||
if (!(originalData[$"{k[..2]}/"]?.AsValue().TryGetValue<decimal>(out var o) ?? false) || o == v)
|
||||
data.Remove(k);
|
||||
}
|
||||
data["default"] = v;
|
||||
CollapsePaymentData(data, vaributes, useDefault);
|
||||
CollapsePaymentData(data, originalData, vaributes, useDefault);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -330,16 +336,26 @@ namespace Elwig.Helpers.Billing {
|
||||
var len = vaributes.Count(e => $"{e.AttrId}{(e.CultId != null && e.CultId != "" ? "-" : "")}{e.CultId}" == idx);
|
||||
foreach (var (v, ks) in rev1) {
|
||||
var myKs = ks.Where(k => k.EndsWith($"/{idx}")).ToList();
|
||||
if (myKs.Count > 1 && ((myKs.Count >= len * 0.5 && useDefault) || myKs.Count == len)) {
|
||||
if (myKs.Count > 1 && ((myKs.Count > len * 0.5 && useDefault) || myKs.Count == len)) {
|
||||
foreach (var k in myKs) data.Remove(k);
|
||||
data[(idx.StartsWith('-') && !useDefault ? "" : "/") + idx] = v;
|
||||
var discr = (idx.StartsWith('-') && !useDefault ? "" : "/") + idx;
|
||||
data[discr] = v;
|
||||
foreach (var (k, o) in originalData) {
|
||||
if (o!.AsValue().TryGetValue<string>(out var o2) && o2 != v && k.Contains(discr))
|
||||
data[k] = o2;
|
||||
}
|
||||
}
|
||||
}
|
||||
foreach (var (v, ks) in rev2) {
|
||||
var myKs = ks.Where(k => k.EndsWith($"/{idx}")).ToList();
|
||||
if (myKs.Count > 1 && ((myKs.Count >= len * 0.5 && useDefault) || myKs.Count == len)) {
|
||||
if (myKs.Count > 1 && ((myKs.Count > len * 0.5 && useDefault) || myKs.Count == len)) {
|
||||
foreach (var k in myKs) data.Remove(k);
|
||||
data[(idx.StartsWith('-') && !useDefault ? "" : "/") + idx] = v;
|
||||
var discr = (idx.StartsWith('-') && !useDefault ? "" : "/") + idx;
|
||||
data[discr] = v;
|
||||
foreach (var (k, o) in originalData) {
|
||||
if (o!.AsValue().TryGetValue<decimal>(out var o2) && o2 != v && k.Contains(discr))
|
||||
data[k] = o2;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -360,8 +376,8 @@ namespace Elwig.Helpers.Billing {
|
||||
|
||||
(rev1, rev2) = GetReverseKeys(data, false);
|
||||
var keyVaributes = data
|
||||
.Select(e => e.Key.Split('-')[0])
|
||||
.Where(e => e.Length > 0 && e != "default")
|
||||
.Select(e => e.Key)
|
||||
.Where(e => e.Length > 0 && !e.Contains('-') && e != "default")
|
||||
.Distinct()
|
||||
.ToList();
|
||||
foreach (var idx in keyVaributes) {
|
||||
@ -419,8 +435,8 @@ namespace Elwig.Helpers.Billing {
|
||||
}
|
||||
}
|
||||
|
||||
CollapsePaymentData(payment, vaributes ?? payment.Select(e => new RawVaribute(e.Key)).ToList(), useDefaultPayment);
|
||||
CollapsePaymentData(qualityWei, vaributes ?? qualityWei.Select(e => new RawVaribute(e.Key)).ToList(), useDefaultQuality);
|
||||
CollapsePaymentData(payment, payment.DeepClone().AsObject(), vaributes ?? payment.Select(e => new RawVaribute(e.Key)).ToList(), useDefaultPayment);
|
||||
CollapsePaymentData(qualityWei, qualityWei.DeepClone().AsObject(), vaributes ?? qualityWei.Select(e => new RawVaribute(e.Key)).ToList(), useDefaultQuality);
|
||||
|
||||
var data = new JsonObject {
|
||||
["mode"] = "elwig",
|
||||
|
@ -10,7 +10,6 @@ using Elwig.Helpers.Billing;
|
||||
using Elwig.Models.Entities;
|
||||
using ScottPlot.Plottables;
|
||||
using ScottPlot;
|
||||
using ScottPlot.Control;
|
||||
|
||||
namespace Elwig.Windows {
|
||||
public partial class ChartWindow : ContextWindow {
|
||||
@ -226,20 +225,20 @@ namespace Elwig.Windows {
|
||||
DataPlot.Color = ColorUngebunden;
|
||||
DataPlot.MarkerStyle = new MarkerStyle(MarkerShape.FilledCircle, 9, ColorUngebunden);
|
||||
|
||||
OechslePricePlot.Interaction.Enable(new PlotActions() {
|
||||
ZoomIn = StandardActions.ZoomIn,
|
||||
ZoomOut = StandardActions.ZoomOut,
|
||||
PanUp = StandardActions.PanUp,
|
||||
PanDown = StandardActions.PanDown,
|
||||
PanLeft = StandardActions.PanLeft,
|
||||
PanRight = StandardActions.PanRight,
|
||||
DragPan = StandardActions.DragPan,
|
||||
DragZoom = StandardActions.DragZoom,
|
||||
DragZoomRectangle = StandardActions.DragZoomRectangle,
|
||||
ZoomRectangleClear = StandardActions.ZoomRectangleClear,
|
||||
ZoomRectangleApply = StandardActions.ZoomRectangleApply,
|
||||
AutoScale = StandardActions.AutoScale,
|
||||
});
|
||||
//OechslePricePlot.Interaction.Enable(new PlotActions() {
|
||||
// ZoomIn = StandardActions.ZoomIn,
|
||||
// ZoomOut = StandardActions.ZoomOut,
|
||||
// PanUp = StandardActions.PanUp,
|
||||
// PanDown = StandardActions.PanDown,
|
||||
// PanLeft = StandardActions.PanLeft,
|
||||
// PanRight = StandardActions.PanRight,
|
||||
// DragPan = StandardActions.DragPan,
|
||||
// DragZoom = StandardActions.DragZoom,
|
||||
// DragZoomRectangle = StandardActions.DragZoomRectangle,
|
||||
// ZoomRectangleClear = StandardActions.ZoomRectangleClear,
|
||||
// ZoomRectangleApply = StandardActions.ZoomRectangleApply,
|
||||
// AutoScale = StandardActions.AutoScale,
|
||||
//});
|
||||
|
||||
//OechslePricePlot.Plot.XAxis.ManualTickSpacing(1);
|
||||
//OechslePricePlot.Plot.YAxis.ManualTickSpacing(0.1);
|
||||
|
@ -1,6 +1,5 @@
|
||||
using Elwig.Helpers;
|
||||
using Elwig.Helpers.Billing;
|
||||
using Elwig.Models.Entities;
|
||||
using System.Text.Json;
|
||||
|
||||
namespace Tests.HelperTests {
|
||||
@ -452,7 +451,7 @@ namespace Tests.HelperTests {
|
||||
[73] = 0.5m,
|
||||
[83] = 1.0m
|
||||
}, null), GetSelection(["GV/-"]))
|
||||
];
|
||||
];
|
||||
var data = BillingData.FromGraphEntries(entries);
|
||||
Assert.That(data.ToJsonString(JsonOpts), Is.EqualTo("""
|
||||
{
|
||||
@ -476,14 +475,14 @@ namespace Tests.HelperTests {
|
||||
[Test]
|
||||
public void TestWrite_04_Simple() {
|
||||
List<GraphEntry> entries = [
|
||||
new GraphEntry(0, 4, new BillingData.Curve(BillingData.CurveMode.Oe, new() {
|
||||
[73] = 0.5m,
|
||||
[84] = 1.0m
|
||||
}, null), GetSelection(["GV/-", "ZW/-"])),
|
||||
new GraphEntry(0, 4, new BillingData.Curve(BillingData.CurveMode.Oe, new() {
|
||||
[73] = 0.5m,
|
||||
[84] = 1.0m
|
||||
}, null), GetSelection(["GV/-", "ZW/-"])),
|
||||
new GraphEntry(10, 4, new BillingData.Curve(BillingData.CurveMode.Oe, new() {
|
||||
[73] = 0.75m,
|
||||
}, null), GetSelection(["WR/-"]))
|
||||
];
|
||||
];
|
||||
var data = BillingData.FromGraphEntries(entries);
|
||||
Assert.That(data.ToJsonString(JsonOpts), Is.EqualTo("""
|
||||
{
|
||||
@ -510,18 +509,18 @@ namespace Tests.HelperTests {
|
||||
[Test]
|
||||
public void TestWrite_05_Attribute() {
|
||||
List<GraphEntry> entries = [
|
||||
new GraphEntry(0, 4, new BillingData.Curve(BillingData.CurveMode.Oe, new() {
|
||||
[73] = 0.5m,
|
||||
[84] = 1.0m
|
||||
}, null), GetSelection(["GV/K-", "ZW/K-"])),
|
||||
new GraphEntry(0, 4, new BillingData.Curve(BillingData.CurveMode.Oe, new() {
|
||||
[73] = 0.5m,
|
||||
[84] = 1.0m
|
||||
}, null), GetSelection(["GV/K-", "ZW/K-"])),
|
||||
new GraphEntry(2, 4, new BillingData.Curve(BillingData.CurveMode.Oe, new() {
|
||||
[73] = 0.75m,
|
||||
}, null), GetSelection(["WR/-", "BL/-", "RR/-", "FV/-"])),
|
||||
}, null), GetSelection(["WR/-", "BL/-", "RR/-", "FV/-", "GV/-"])),
|
||||
new GraphEntry(4, 4, new BillingData.Curve(BillingData.CurveMode.Oe, new() {
|
||||
[73] = 0.65m,
|
||||
[84] = 1.2m
|
||||
}, null), GetSelection(["BP/-", "SA/-"]))
|
||||
];
|
||||
];
|
||||
var data = BillingData.FromGraphEntries(entries);
|
||||
Assert.That(data.ToJsonString(JsonOpts), Is.EqualTo("""
|
||||
{
|
||||
@ -564,12 +563,12 @@ namespace Tests.HelperTests {
|
||||
}, null), GetSelection(["GV/-B", "ZW/-B"])),
|
||||
new GraphEntry(2, 4, new BillingData.Curve(BillingData.CurveMode.Oe, new() {
|
||||
[73] = 0.75m,
|
||||
}, null), GetSelection(["WR/-", "BL/-", "RR/-", "FV/-"])),
|
||||
}, null), GetSelection(["WR/-", "BL/-", "RR/-", "FV/-", "GV/-"])),
|
||||
new GraphEntry(4, 4, new BillingData.Curve(BillingData.CurveMode.Oe, new() {
|
||||
[73] = 0.65m,
|
||||
[84] = 1.2m
|
||||
}, null), GetSelection(["BP/-", "SA/-"]))
|
||||
];
|
||||
];
|
||||
var data = BillingData.FromGraphEntries(entries);
|
||||
Assert.That(data.ToJsonString(JsonOpts), Is.EqualTo("""
|
||||
{
|
||||
@ -616,7 +615,7 @@ namespace Tests.HelperTests {
|
||||
new GraphEntry(2, 4, new BillingData.Curve(BillingData.CurveMode.Oe, new() {
|
||||
[73] = 0.8m,
|
||||
}, null), GetSelection(["BP/-", "BP/-B"])),
|
||||
];
|
||||
];
|
||||
var data = BillingData.FromGraphEntries(entries);
|
||||
Assert.That(data.ToJsonString(JsonOpts), Is.EqualTo("""
|
||||
{
|
||||
@ -653,8 +652,8 @@ namespace Tests.HelperTests {
|
||||
}, null), GetSelection(["BP/-B", "ZW/-B", "FV/-B"])),
|
||||
new GraphEntry(2, 4, new BillingData.Curve(BillingData.CurveMode.Oe, new() {
|
||||
[73] = 0.8m,
|
||||
}, null), GetSelection(["BP/-", "ZW/-", "FV/-", "WR/-", "BL/-"])),
|
||||
];
|
||||
}, null), GetSelection(["BP/-", "ZW/-", "FV/-", "WR/-", "BL/-", "RR/-"])),
|
||||
];
|
||||
var data = BillingData.FromGraphEntries(entries);
|
||||
Assert.That(data.ToJsonString(JsonOpts), Is.EqualTo("""
|
||||
{
|
||||
@ -711,5 +710,267 @@ namespace Tests.HelperTests {
|
||||
}
|
||||
"""));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestWrite_10_QualityLevel() {
|
||||
List<GraphEntry> entries = [
|
||||
new GraphEntry(0, 4, new BillingData.Curve(BillingData.CurveMode.Oe, new() {
|
||||
[73] = 0.1m,
|
||||
}, null), GetSelection(["GV/-"])),
|
||||
new GraphEntry(1, 4, new BillingData.Curve(BillingData.CurveMode.Oe, new() {
|
||||
[73] = 0.2m,
|
||||
}, null), GetSelection(["ZW/-"]))
|
||||
];
|
||||
entries[0].Abgewertet = true;
|
||||
var data = BillingData.FromGraphEntries(entries);
|
||||
Assert.That(data.ToJsonString(JsonOpts), Is.EqualTo("""
|
||||
{
|
||||
"mode": "elwig",
|
||||
"version": 1,
|
||||
"payment": 0.2,
|
||||
"quality": {
|
||||
"WEI": 0.1
|
||||
},
|
||||
"curves": []
|
||||
}
|
||||
"""));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestWrite_11_MixedCultivation_1() {
|
||||
List<GraphEntry> entries = [
|
||||
new GraphEntry(0, 4, new BillingData.Curve(BillingData.CurveMode.Oe, new() {
|
||||
[73] = 0.1m,
|
||||
}, null), GetSelection(["GV/-", "WR/-"])),
|
||||
new GraphEntry(1, 4, new BillingData.Curve(BillingData.CurveMode.Oe, new() {
|
||||
[73] = 0.2m,
|
||||
}, null), GetSelection(["GV/-B"]))
|
||||
];
|
||||
var data = BillingData.FromGraphEntries(entries);
|
||||
Assert.That(data.ToJsonString(JsonOpts), Is.EqualTo("""
|
||||
{
|
||||
"mode": "elwig",
|
||||
"version": 1,
|
||||
"payment": {
|
||||
"default": 0.1,
|
||||
"GV-B": 0.2
|
||||
},
|
||||
"curves": []
|
||||
}
|
||||
"""));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestWrite_12_MixedCultivation_2() {
|
||||
List<GraphEntry> entries = [
|
||||
new GraphEntry(0, 4, new BillingData.Curve(BillingData.CurveMode.Oe, new() {
|
||||
[73] = 0.1m,
|
||||
}, null), GetSelection(["GV/-", "ZW/-", "WR/-", "FV/-", "RR/-"])),
|
||||
new GraphEntry(1, 4, new BillingData.Curve(BillingData.CurveMode.Oe, new() {
|
||||
[73] = 0.2m,
|
||||
}, null), GetSelection(["GV/-B", "FV/-B"])),
|
||||
new GraphEntry(2, 4, new BillingData.Curve(BillingData.CurveMode.Oe, new() {
|
||||
[73] = 0.3m,
|
||||
}, null), GetSelection(["ZW/-B", "WR/-B"]))
|
||||
];
|
||||
var data = BillingData.FromGraphEntries(entries);
|
||||
Assert.That(data.ToJsonString(JsonOpts), Is.EqualTo("""
|
||||
{
|
||||
"mode": "elwig",
|
||||
"version": 1,
|
||||
"payment": {
|
||||
"default": 0.1,
|
||||
"GV-B": 0.2,
|
||||
"FV-B": 0.2,
|
||||
"ZW-B": 0.3,
|
||||
"WR-B": 0.3
|
||||
},
|
||||
"curves": []
|
||||
}
|
||||
"""));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestWrite_13_DefaultCultivation_1() {
|
||||
List<GraphEntry> entries = [
|
||||
new GraphEntry(0, 4, new BillingData.Curve(BillingData.CurveMode.Oe, new() {
|
||||
[73] = 0.1m,
|
||||
}, null), GetSelection(["GV/-", "GV/-B"])),
|
||||
new GraphEntry(1, 4, new BillingData.Curve(BillingData.CurveMode.Oe, new() {
|
||||
[73] = 0.2m,
|
||||
}, null), GetSelection(["WR/-B"]))
|
||||
];
|
||||
var data = BillingData.FromGraphEntries(entries);
|
||||
Assert.That(data.ToJsonString(JsonOpts), Is.EqualTo("""
|
||||
{
|
||||
"mode": "elwig",
|
||||
"version": 1,
|
||||
"payment": {
|
||||
"default": 0.1,
|
||||
"WR-B": 0.2
|
||||
},
|
||||
"curves": []
|
||||
}
|
||||
"""));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestWrite_14_DefaultCultivation_2() {
|
||||
List<GraphEntry> entries = [
|
||||
new GraphEntry(0, 4, new BillingData.Curve(BillingData.CurveMode.Oe, new() {
|
||||
[73] = 0.1m,
|
||||
}, null), GetSelection(["GV/-", "GV/-B", "ZW/-"])),
|
||||
new GraphEntry(1, 4, new BillingData.Curve(BillingData.CurveMode.Oe, new() {
|
||||
[73] = 0.2m,
|
||||
}, null), GetSelection(["WR/-B", "ZW/-B"]))
|
||||
];
|
||||
var data = BillingData.FromGraphEntries(entries);
|
||||
Assert.That(data.ToJsonString(JsonOpts), Is.EqualTo("""
|
||||
{
|
||||
"mode": "elwig",
|
||||
"version": 1,
|
||||
"payment": {
|
||||
"default": 0.1,
|
||||
"-B": 0.2,
|
||||
"GV-B": 0.1
|
||||
},
|
||||
"curves": []
|
||||
}
|
||||
"""));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestWrite_15_DefaultCultivation_3() {
|
||||
List<GraphEntry> entries = [
|
||||
new GraphEntry(0, 4, new BillingData.Curve(BillingData.CurveMode.Oe, new() {
|
||||
[73] = 0.1m,
|
||||
}, null), GetSelection(["GV/-", "GV/-B", "ZW/-"])),
|
||||
new GraphEntry(1, 4, new BillingData.Curve(BillingData.CurveMode.Oe, new() {
|
||||
[73] = 0.2m,
|
||||
}, null), GetSelection(["GV/S-", "GV/S-B", "ZW/S-"])),
|
||||
new GraphEntry(2, 4, new BillingData.Curve(BillingData.CurveMode.Oe, new() {
|
||||
[73] = 0.3m,
|
||||
}, null), GetSelection(["WR/S-B", "ZW/S-B"]))
|
||||
];
|
||||
var data = BillingData.FromGraphEntries(entries);
|
||||
Assert.That(data.ToJsonString(JsonOpts), Is.EqualTo("""
|
||||
{
|
||||
"mode": "elwig",
|
||||
"version": 1,
|
||||
"payment": {
|
||||
"GV/S-B": 0.2,
|
||||
"/S": 0.2,
|
||||
"/S-B": 0.3,
|
||||
"GV": 0.1,
|
||||
"ZW": 0.1
|
||||
},
|
||||
"curves": []
|
||||
}
|
||||
"""));
|
||||
}
|
||||
|
||||
|
||||
[Test]
|
||||
public void TestWrite_16_DefaultCultivation_4() {
|
||||
List<GraphEntry> entries = [
|
||||
new GraphEntry(0, 4, new BillingData.Curve(BillingData.CurveMode.Oe, new() {
|
||||
[73] = 0.1m,
|
||||
}, null), GetSelection(["GV/-", "RR/-B", "ZW/-"])),
|
||||
new GraphEntry(1, 4, new BillingData.Curve(BillingData.CurveMode.Oe, new() {
|
||||
[73] = 0.2m,
|
||||
}, null), GetSelection(["RR/-"]))
|
||||
];
|
||||
var data = BillingData.FromGraphEntries(entries);
|
||||
Assert.That(data.ToJsonString(JsonOpts), Is.EqualTo("""
|
||||
{
|
||||
"mode": "elwig",
|
||||
"version": 1,
|
||||
"payment": {
|
||||
"default": 0.1,
|
||||
"RR-B": 0.1,
|
||||
"RR": 0.2
|
||||
},
|
||||
"curves": []
|
||||
}
|
||||
"""));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestWrite_17_DefaultCultivation_5() {
|
||||
List<GraphEntry> entries = [
|
||||
new GraphEntry(0, 4, new BillingData.Curve(BillingData.CurveMode.Oe, new() {
|
||||
[73] = 0.1m,
|
||||
}, null), GetSelection(["GV/-", "RR/-B", "ZW/-", "SW/-", "SO/-"])),
|
||||
new GraphEntry(1, 4, new BillingData.Curve(BillingData.CurveMode.Oe, new() {
|
||||
[73] = 0.2m,
|
||||
}, null), GetSelection(["GV/K-", "RR/K-B", "ZW/K-"])),
|
||||
new GraphEntry(2, 4, new BillingData.Curve(BillingData.CurveMode.Oe, new() {
|
||||
[73] = 0.3m,
|
||||
}, null), GetSelection(["RR/K-"]))
|
||||
];
|
||||
var data = BillingData.FromGraphEntries(entries);
|
||||
Assert.That(data.ToJsonString(JsonOpts), Is.EqualTo("""
|
||||
{
|
||||
"mode": "elwig",
|
||||
"version": 1,
|
||||
"payment": {
|
||||
"RR/K-B": 0.2,
|
||||
"RR/K": 0.3,
|
||||
"default": 0.1,
|
||||
"/K": 0.2
|
||||
},
|
||||
"curves": []
|
||||
}
|
||||
"""));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestWrite_18_DefaultAttribute_1() {
|
||||
List<GraphEntry> entries = [
|
||||
new GraphEntry(0, 4, new BillingData.Curve(BillingData.CurveMode.Oe, new() {
|
||||
[73] = 0.1m,
|
||||
}, null), GetSelection(["GV/-", "GV/S-"])),
|
||||
new GraphEntry(1, 4, new BillingData.Curve(BillingData.CurveMode.Oe, new() {
|
||||
[73] = 0.2m,
|
||||
}, null), GetSelection(["WR/S-"]))
|
||||
];
|
||||
var data = BillingData.FromGraphEntries(entries);
|
||||
Assert.That(data.ToJsonString(JsonOpts), Is.EqualTo("""
|
||||
{
|
||||
"mode": "elwig",
|
||||
"version": 1,
|
||||
"payment": {
|
||||
"WR/S": 0.2,
|
||||
"default": 0.1
|
||||
},
|
||||
"curves": []
|
||||
}
|
||||
"""));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestWrite_19_DefaultAttribute_2() {
|
||||
List<GraphEntry> entries = [
|
||||
new GraphEntry(0, 4, new BillingData.Curve(BillingData.CurveMode.Oe, new() {
|
||||
[73] = 0.1m,
|
||||
}, null), GetSelection(["GV/-", "GV/S-", "ZW/-"])),
|
||||
new GraphEntry(1, 4, new BillingData.Curve(BillingData.CurveMode.Oe, new() {
|
||||
[73] = 0.2m,
|
||||
}, null), GetSelection(["WR/S-", "ZW/S-"]))
|
||||
];
|
||||
var data = BillingData.FromGraphEntries(entries);
|
||||
Assert.That(data.ToJsonString(JsonOpts), Is.EqualTo("""
|
||||
{
|
||||
"mode": "elwig",
|
||||
"version": 1,
|
||||
"payment": {
|
||||
"default": 0.1,
|
||||
"/S": 0.2,
|
||||
"GV/S": 0.1
|
||||
},
|
||||
"curves": []
|
||||
}
|
||||
"""));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -24,7 +24,7 @@
|
||||
<PackageReference Include="NReco.PdfRenderer" Version="1.6.0" />
|
||||
<PackageReference Include="NUnit" Version="4.3.2" />
|
||||
<PackageReference Include="NUnit3TestAdapter" Version="4.6.0" />
|
||||
<PackageReference Include="NUnit.Analyzers" Version="4.5.0">
|
||||
<PackageReference Include="NUnit.Analyzers" Version="4.6.0">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
|
Reference in New Issue
Block a user