public void Test_SpeedResponse_Creation() { var response = new SpeedStatisticsResponse(); Assert.True(response.ResultStatus == RequestErrorStatus.Unknown, "ResultStatus invalid after creation."); Assert.True(response.CellSize < Consts.TOLERANCE_DIMENSION, "CellSize invalid after creation."); Assert.True(response.SummaryCellsScanned == 0, "Invalid initial value for SummaryCellsScanned."); Assert.True(response.CellsScannedOverTarget == 0, "Invalid initial value for CellsScannedOverTarget."); Assert.True(response.CellsScannedAtTarget == 0, "Invalid initial value for CellsScannedAtTarget."); Assert.True(response.CellsScannedUnderTarget == 0, "Invalid initial value for CellsScannedUnderTarget."); Assert.True(response.IsTargetValueConstant, "Invalid initial value for IsTargetValueConstant."); Assert.True(!response.MissingTargetValue, "Invalid initial value for MissingTargetValue."); }
public void Test_SpeedCoordinator_ReadOutResults_Successful() { var aggregator = _getSpeedAggregator(); var coordinator = _getCoordinator(); var response = new SpeedStatisticsResponse(); coordinator.ReadOutResults(aggregator, response); Assert.True(Math.Abs(response.CellSize - aggregator.CellSize) < Consts.TOLERANCE_DIMENSION, "CellSize invalid after result read-out."); Assert.True(response.SummaryCellsScanned == aggregator.SummaryCellsScanned, "Invalid read-out value for SummaryCellsScanned."); Assert.True(response.CellsScannedOverTarget == aggregator.CellsScannedOverTarget, "Invalid read-out value for CellsScannedOverTarget."); Assert.True(response.CellsScannedAtTarget == aggregator.CellsScannedAtTarget, "Invalid read-out value for CellsScannedAtTarget."); Assert.True(response.CellsScannedUnderTarget == aggregator.CellsScannedUnderTarget, "Invalid read-out value for CellsScannedUnderTarget."); Assert.True(response.IsTargetValueConstant == aggregator.IsTargetValueConstant, "Invalid read-out value for IsTargetValueConstant."); Assert.True(response.MissingTargetValue == aggregator.MissingTargetValue, "Invalid initial read-out for MissingTargetValue."); }
public void Test_SpeedStatisticsResponse() { var response = new SpeedStatisticsResponse() { 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 SpeedStatisticsResponse not same after round trip serialisation"); }
public void Test_TemperatureResponse_AgregateWith_Successful() { var responseClone = new SpeedStatisticsResponse() { ResultStatus = _response.ResultStatus, CellSize = _response.CellSize, CellsScannedOverTarget = _response.CellsScannedOverTarget, CellsScannedAtTarget = _response.CellsScannedAtTarget, CellsScannedUnderTarget = _response.CellsScannedUnderTarget, SummaryCellsScanned = _response.SummaryCellsScanned, IsTargetValueConstant = _response.IsTargetValueConstant, }; var response = _response.AggregateWith(responseClone); Assert.True(Math.Abs(response.CellSize - _response.CellSize) < Consts.TOLERANCE_DIMENSION, "CellSize invalid after aggregation."); Assert.True(response.SummaryCellsScanned == _response.SummaryCellsScanned * 2, "Invalid aggregated value for SummaryCellsScanned."); Assert.True(response.CellsScannedOverTarget == _response.CellsScannedOverTarget * 2, "Invalid aggregated value for CellsScannedOverTarget."); Assert.True(response.CellsScannedAtTarget == _response.CellsScannedAtTarget * 2, "Invalid aggregated value for CellsScannedAtTarget."); Assert.True(response.CellsScannedUnderTarget == _response.CellsScannedUnderTarget * 2, "Invalid aggregated value for CellsScannedUnderTarget."); Assert.True(response.IsTargetValueConstant == _response.IsTargetValueConstant, "Invalid aggregated value for IsTargetValueConstant."); Assert.True(response.MissingTargetValue == _response.MissingTargetValue, "Invalid aggregated value for MissingTargetValue."); }