public void ConstructResult() { var response = new CutFillStatisticsResponse { Counts = new long[] { 1, 2, 3, 4, 5, 6, 7 }, ResultStatus = RequestErrorStatus.OK }; var result = response.ConstructResult(); result.Counts.Should().BeEquivalentTo(new long[] { 1, 2, 3, 4, 5, 6, 7 }); result.ResultStatus.Should().Be(RequestErrorStatus.OK); }
public void Test_CutFillStatisticsResponse() { var response = new CutFillStatisticsResponse() { ResultStatus = RequestErrorStatus.OK, CellSize = TestConsts.CELL_SIZE, CellsScannedOverTarget = TestConsts.CELLS_OVER_TARGET, CellsScannedAtTarget = TestConsts.CELLS_AT_TARGET, CellsScannedUnderTarget = TestConsts.CELLS_UNDER_TARGET, SummaryCellsScanned = TestConsts.CELLS_OVER_TARGET + TestConsts.CELLS_AT_TARGET + TestConsts.CELLS_UNDER_TARGET, IsTargetValueConstant = true, Counts = TestConsts.CountsArray, MissingTargetValue = false }; SimpleBinarizableInstanceTester.TestClass(response, "Custom CutFillStatisticsResponse not same after round trip serialisation"); }
public void AggregateWith() { var response = new CutFillStatisticsResponse { Counts = new long[] { 1, 2, 3, 4, 5, 6, 7 }, CellsScannedAtTarget = 10, CellsScannedUnderTarget = 11, CellsScannedOverTarget = 12 }; var otherResponse = new CutFillStatisticsResponse { Counts = new long[] { 1, 2, 3, 4, 5, 6, 7 }, CellsScannedAtTarget = 10, CellsScannedUnderTarget = 11, CellsScannedOverTarget = 12 }; response.AggregateWith(otherResponse); response.Counts.Should().BeEquivalentTo(new long[] { 2, 4, 6, 8, 10, 12, 14 }); response.CellsScannedAtTarget.Should().Be(20); response.CellsScannedUnderTarget.Should().Be(22); response.CellsScannedOverTarget.Should().Be(24); }