Weighing: Differentiate between scale and terminal

This commit is contained in:
2026-08-03 10:56:36 +02:00
parent 0d8cdd5d6e
commit 309f118739
20 changed files with 130 additions and 158 deletions
@@ -40,21 +40,25 @@ namespace Tests.UnitTests.WeighingTests {
MockA.Weight = 1234;
Assert.That(await ScaleA!.GetCurrentWeight(), Is.EqualTo(new WeighingResult {
GrossWeight = 1234, TareWeight = 0, NetWeight = 1234,
ScaleId = "1",
Date = new DateOnly(2020, 10, 8), Time = new TimeOnly(8, 47),
}));
MockB.Weight = 3456;
Assert.That(await ScaleB!.GetCurrentWeight(), Is.EqualTo(new WeighingResult {
GrossWeight = 3456, TareWeight = 0, NetWeight = 3456,
ScaleId = "1",
Date = new DateOnly(2020, 10, 8), Time = new TimeOnly(8, 47),
}));
MockA.Weight = 1236;
Assert.That(await ScaleA!.GetCurrentWeight(), Is.EqualTo(new WeighingResult {
GrossWeight = 1236, TareWeight = 0, NetWeight = 1236,
ScaleId = "1",
Date = new DateOnly(2020, 10, 8), Time = new TimeOnly(8, 47),
}));
MockB.Weight = 3457;
Assert.That(await ScaleB!.GetCurrentWeight(), Is.EqualTo(new WeighingResult {
GrossWeight = 3457, TareWeight = 0, NetWeight = 3457,
ScaleId = "1",
Date = new DateOnly(2020, 10, 8), Time = new TimeOnly(8, 47),
}));
}
@@ -64,25 +68,25 @@ namespace Tests.UnitTests.WeighingTests {
MockA.Weight = 1234;
Assert.That(await ScaleA!.Weigh(), Is.EqualTo(new WeighingResult {
GrossWeight = 1234, TareWeight = 0, NetWeight = 1234,
WeighingId = "1", FullWeighingId = $"2020-10-08/1",
ScaleId = "1", WeighingId = "1", FullWeighingId = $"2020-10-08/1",
Date = new DateOnly(2020, 10, 8), Time = new TimeOnly(8, 47),
}));
MockB.Weight = 3456;
Assert.That(await ScaleB!.Weigh(), Is.EqualTo(new WeighingResult {
GrossWeight = 3456, TareWeight = 0, NetWeight = 3456,
WeighingId = "1", FullWeighingId = $"2020-10-08/1",
ScaleId = "1", WeighingId = "1", FullWeighingId = $"2020-10-08/1",
Date = new DateOnly(2020, 10, 8), Time = new TimeOnly(8, 47),
}));
MockA.Weight = 4321;
Assert.That(await ScaleA!.Weigh(), Is.EqualTo(new WeighingResult {
GrossWeight = 4321, TareWeight = 0, NetWeight = 4321,
WeighingId = "2", FullWeighingId = $"2020-10-08/2",
ScaleId = "1", WeighingId = "2", FullWeighingId = $"2020-10-08/2",
Date = new DateOnly(2020, 10, 8), Time = new TimeOnly(8, 47),
}));
MockB.Weight = 3333;
Assert.That(await ScaleB!.Weigh(), Is.EqualTo(new WeighingResult {
GrossWeight = 3333, TareWeight = 0, NetWeight = 3333,
WeighingId = "2", FullWeighingId = $"2020-10-08/2",
ScaleId = "1", WeighingId = "2", FullWeighingId = $"2020-10-08/2",
Date = new DateOnly(2020, 10, 8), Time = new TimeOnly(8, 47),
}));
}