public void Test_ElevationStatisticsResponse_Creation() { var response = new ElevationStatisticsResponse(); Assert.True(response.ResultStatus == RequestErrorStatus.Unknown, "ResultStatus invalid after ElevationStatisticsResponse creation."); Assert.True(response.CellSize < Consts.TOLERANCE_DIMENSION, "CellSize invalid after ElevationStatisticsResponse creation."); Assert.True(Math.Abs(response.MinElevation) < Consts.TOLERANCE_HEIGHT, "Invalid initial value for MinElevation."); Assert.True(Math.Abs(response.MaxElevation) < Consts.TOLERANCE_HEIGHT, "Invalid initial value for MaxElevation."); Assert.True(response.CellsUsed == 0, "Invalid initial value for CellsUsed."); Assert.True(response.CellsScanned == 0, "Invalid initial value for CellsScanned."); Assert.True(response.BoundingExtents.IsValidPlanExtent, "Invalid plan extents."); }
public void Test_ElevationCoordinator_ReadOutResults_Successful() { var aggregator = _getElevationAggregator(); var coordinator = _getCoordinator(); var response = new ElevationStatisticsResponse(); coordinator.ReadOutResults(aggregator, response); Assert.True(Math.Abs(response.CellSize - aggregator.CellSize) < Consts.TOLERANCE_DIMENSION, "CellSize invalid after result read-out."); Assert.True(Math.Abs(response.MinElevation - aggregator.MinElevation) < Consts.TOLERANCE_HEIGHT, "Invalid read-out value for MinElevation."); Assert.True(Math.Abs(response.MaxElevation - aggregator.MaxElevation) < Consts.TOLERANCE_HEIGHT, "Invalid read-out value for MaxElevation."); Assert.True(response.CellsUsed == aggregator.CellsUsed, "Invalid read-out value for CellsUsed."); Assert.True(response.CellsScanned == aggregator.CellsScanned, "Invalid read-out value for CellsScanned."); Assert.True(!response.BoundingExtents.IsValidPlanExtent, "Response BoundingExtents should be inverted."); Assert.True(!aggregator.BoundingExtents.IsValidPlanExtent, "Aggregator BoundingExtents should be inverted."); Assert.True(response.BoundingExtents.Equals(aggregator.BoundingExtents), "Aggregator and response BoundingExtents are not equal."); response.TotalArea.Should().Be(0); }
public void Test_ElevationStatisticsResponse_AgregateWith_Successful() { var responseClone = new ElevationStatisticsResponse() { ResultStatus = _response.ResultStatus, CellSize = _response.CellSize, MinElevation = _response.MinElevation, MaxElevation = _response.MaxElevation, CellsUsed = _response.CellsUsed, CellsScanned = _response.CellsScanned, BoundingExtents = _response.BoundingExtents }; var response = _response.AggregateWith(responseClone); Assert.True(Math.Abs(response.CellSize - _response.CellSize) < Consts.TOLERANCE_DIMENSION, "CellSize invalid after aggregation."); Assert.True(Math.Abs(response.MinElevation - _response.MinElevation) < Consts.TOLERANCE_HEIGHT, "Invalid aggregated value for MinElevation."); Assert.True(Math.Abs(response.MaxElevation - _response.MaxElevation) < Consts.TOLERANCE_HEIGHT, "Invalid aggregated value for MaxElevation."); Assert.True(response.CellsUsed == _response.CellsUsed * 2, "Invalid aggregated value for CellsUsed."); Assert.True(response.CellsScanned == _response.CellsScanned * 2, "Invalid aggregated value for CellsScanned."); Assert.True(response.BoundingExtents.IsValidPlanExtent, "Response invalid plan extents."); Assert.True(_response.BoundingExtents.IsValidPlanExtent, "_Response invalid plan extents."); Assert.True(response.BoundingExtents.Equals(_response.BoundingExtents), "Response and _response BoundingExtents are not equal."); }