public void Test_CellDatumResponse_ApplicationService_MinimalContent() { var response = new CellDatumResponse_ApplicationService { DisplayMode = DisplayMode.PassCount, ReturnCode = CellDatumReturnCode.NoValueFound }; SimpleBinarizableInstanceTester.TestClass(response, "Minimal CellDatumResponse_ApplicationService not same after round trip serialisation"); }
public void Test_CellDatumResponse_ClusterCompute_WithContent() { var response = new CellDatumResponse_ClusterCompute { ReturnCode = CellDatumReturnCode.ValueFound, Value = 5, TimeStampUTC = DateTime.UtcNow.AddHours(-2.5) }; SimpleBinarizableInstanceTester.TestClass(response, "Custom CellDatumResponse_ClusterCompute not same after round trip serialisation"); }
public void Test_CalculateDesignProfileResponse() { var response = new CalculateDesignProfileResponse { Profile = new List <XYZS> { new XYZS(0, 0, 0, 0, 0), new XYZS(100, 101, 102, 103, 104) } }; SimpleBinarizableInstanceTester.TestClass(response, "Custom CalculateDesignProfileResponse not same after round trip serialisation"); }
public void Test_TINSurfaceRequestArgument() { var argument = new TINSurfaceRequestArgument() { ProjectID = Guid.NewGuid(), Filters = new FilterSet(new CombinedFilter()), Tolerance = 0.1 }; SimpleBinarizableInstanceTester.TestClass(argument, "Custom TINSurfaceRequestArgument not same after round trip serialisation"); }
public void Test_BaseDesignRequestResponse_Custom() { var response = new BaseDesignRequestResponse { RequestResult = DesignProfilerRequestResult.OK }; var result = SimpleBinarizableInstanceTester.TestClass(response, "Custom BaseDesignRequestResponse not same after round trip serialisation"); result.member.RequestResult.Should().Be(DesignProfilerRequestResult.OK); }
public void Test_SummaryVolumesProfileCell_NotSimple() { var pc = new SummaryVolumeProfileCell { LastCellPassElevation1 = (float)1.0, LastCellPassElevation2 = (float)2.0 }; var result = SimpleBinarizableInstanceTester.TestClassEx(pc, "SummaryVolumes ProfileCell not same after round trip serialisation"); result.member.LastCellPassElevation1.Should().Be((float)1.0); result.member.LastCellPassElevation2.Should().Be((float)2.0); }
public void Test_DesignSubGridRequestArgumentBase_SubgridDetail() { var argument = new DesignSubGridRequestArgumentBase { ProjectID = Guid.NewGuid(), ReferenceDesign = new DesignOffset(Guid.NewGuid(), 123.4), TRexNodeID = Guid.NewGuid(), Filters = null }; SimpleBinarizableInstanceTester.TestClass(argument, "Empty DesignSubGridRequestArgumentBase not same after round trip serialisation"); }
public void Test_CalculateDesignElevationPatchArgument_NullHeights() { var argument = new CalculateDesignElevationPatchResponse { CalcResult = DesignProfilerRequestResult.OK, Heights = new ClientHeightLeafSubGrid() }; var result = SimpleBinarizableInstanceTester.TestClass(argument, "Custom CalculateDesignElevationPatchResponse not same after round trip serialisation"); result.member.Heights.ForEach((x, y) => result.member.Heights.Cells[x, y].Should().Be(0f)); }
public void Test_TINSurfaceRequestResponse_SuccessResult() { var result = new TINSurfaceResult { ResultStatus = RequestErrorStatus.OK, data = Enumerable.Range(0, 100).Select(x => (byte)x).ToArray() }; var roundTripResult = SimpleBinarizableInstanceTester.TestClass(result); roundTripResult.member.Should().BeEquivalentTo(result); }
public void Test_DesignSubGridRequestArgumentBase_FullBits() { var argument = new DesignFilterSubGridMaskResponse { Bits = SubGridTreeBitmapSubGridBits.FullMask }; var result = SimpleBinarizableInstanceTester.TestClass(argument, "Empty DesignFilterSubGridMaskResponse not same after round trip serialisation"); result.member.Bits.IsFull().Should().Be(true); result.member.Bits.CountBits().Should().Be(SubGridTreeConsts.CellsPerSubGrid); }
public void Test_DesignSubGridRequestArgumentBase_OneBit() { var argument = new DesignFilterSubGridMaskResponse { Bits = new SubGridTreeBitmapSubGridBits(SubGridBitsCreationOptions.Unfilled) }; argument.Bits[10, 10] = true; var result = SimpleBinarizableInstanceTester.TestClass(argument, "Empty DesignFilterSubGridMaskResponse not same after round trip serialisation"); result.member.Bits[10, 10].Should().Be(true); result.member.Bits.CountBits().Should().Be(1); }
public void Test_CalculateDesignElevationPatchArgument() { var argument = new CalculateDesignProfileArgument() { ProjectID = Guid.NewGuid(), ReferenceDesign = new DesignOffset(), CellSize = 1.0, StartPoint = new WGS84Point(0, 0), EndPoint = new WGS84Point(100, 100) }; SimpleBinarizableInstanceTester.TestClass(argument, "Custom CalculateDesignProfileArgument not same after round trip serialisation"); }
public void Test_CutFillStatisticsArgument() { var argument = new CutFillStatisticsArgument() { TRexNodeID = Guid.NewGuid(), ProjectID = Guid.NewGuid(), Filters = new FilterSet(new CombinedFilter()), ReferenceDesign = new DesignOffset(), Offsets = new[] { 0.5, 0.2, 0.1, 0, -0.1, -0.2, -0.5 } }; SimpleBinarizableInstanceTester.TestClass(argument, "Custom CutFillStatisticsArgument not same after round trip serialisation"); }
public void Test_PatchRequestArgument() { var argument = new PatchRequestArgument() { ProjectID = Guid.NewGuid(), Filters = new FilterSet(new CombinedFilter()), DataPatchNumber = 0, DataPatchSize = 10, Mode = DisplayMode.Height }; SimpleBinarizableInstanceTester.TestClass(argument, "Custom PatchRequestArgument not same after round trip serialisation"); }
public void Test_CMVChangeStatisticsArgument() { var argument = new CMVChangeStatisticsArgument { TRexNodeID = Guid.NewGuid(), ProjectID = Guid.NewGuid(), Filters = new FilterSet(new CombinedFilter()), ReferenceDesign = new DesignOffset(Guid.NewGuid(), 1.5), CMVChangeDetailsDataValues = new[] { -50.0, -20.0, -10.0, 0.0, 10.0, 20.0, 50.0 } }; SimpleBinarizableInstanceTester.TestClass(argument, "Custom CMVChangeStatisticsArgument not same after round trip serialisation"); }
public void ReadWriteBinarizable() { SimpleBinarizableInstanceTester.TestClass <RebuildSiteModelTAGNotifierListener>("Empty RebuildSiteModelTAGNotifierListener not same after round trip serialisation"); var listener = new RebuildSiteModelTAGNotifierListener(); TestBinarizable_ReaderWriterHelper.RoundTripSerialise(listener); var listener2 = new RebuildSiteModelTAGNotifierListener { MessageTopicName = "TestMessageTopic" }; TestBinarizable_ReaderWriterHelper.RoundTripSerialise(listener2); }
public void Test_CalculateDesignElevationPatchArgument() { var argument = new CalculateDesignElevationPatchArgument() { ProjectID = Guid.NewGuid(), Filters = new FilterSet(new CombinedFilter()), CellSize = TestConsts.CELL_SIZE, ReferenceDesign = new DesignOffset(), OriginX = 12345, OriginY = 67890 }; SimpleBinarizableInstanceTester.TestClass(argument, "Custom CalculateDesignElevationPatchArgument not same after round trip serialisation"); }
public void Test_CellDatumResponse_ApplicationService_WithContent() { var response = new CellDatumResponse_ApplicationService { DisplayMode = DisplayMode.PassCount, ReturnCode = CellDatumReturnCode.ValueFound, Value = 5, TimeStampUTC = DateTime.UtcNow.AddHours(-2.5), Northing = 123456.789, Easting = 98765.4321 }; SimpleBinarizableInstanceTester.TestClass(response, "Custom CellDatumResponse_ApplicationService not same after round trip serialisation"); }
public void Test_CalculateDesignElevationSpotArgument() { var argument = new CalculateDesignElevationSpotArgument { ProjectID = Guid.NewGuid(), SpotX = 123.4, SpotY = 234.5, Filters = null, ReferenceDesign = new DesignOffset(Guid.NewGuid(), 999.9), TRexNodeID = Guid.NewGuid() }; SimpleBinarizableInstanceTester.TestClass(argument, "Custom CalculateDesignElevationSpotArgument not same after round trip serialisation"); }
public void ReadWriteBinarizable() { SimpleBinarizableInstanceTester.TestClass <DesignChangedEventListener>("Empty DesignChangedEventListener not same after round trip serialisation"); var listener = new DesignChangedEventListener(); TestBinarizable_ReaderWriterHelper.RoundTripSerialise(listener); var listener2 = new DesignChangedEventListener("GridName") { MessageTopicName = "TestMessageTopic" }; TestBinarizable_ReaderWriterHelper.RoundTripSerialise(listener2); }
public void Test_OverrideEventRequestArgument() { var argument = new OverrideEventRequestArgument { Undo = true, ProjectID = Guid.NewGuid(), AssetID = Guid.NewGuid(), StartUTC = DateTime.UtcNow.AddMinutes(-2), EndUTC = DateTime.UtcNow, MachineDesignName = "some design", LayerID = 2 }; SimpleBinarizableInstanceTester.TestClass(argument, "Custom OverrideEventRequestArgument not same after round trip serialisation"); }
public void Test_AlignmentDesignFilterBoundaryResponse_Polygon() { var response = new AlignmentDesignFilterBoundaryResponse() { Boundary = new Fence(1, 2, 3, 4) { IsRectangle = false } }; var result = SimpleBinarizableInstanceTester.TestClass(response, "Custom AlignmentDesignFilterBoundaryResponse not same after round trip serialisation"); result.member.Boundary.HasVertices.Should().Be(true); result.member.Boundary.NumVertices.Should().Be(4); result.member.Boundary.IsRectangle.Should().Be(false); }
public void Test_SpeedStatisticsArgument() { var argument = new SpeedStatisticsArgument() { TRexNodeID = Guid.NewGuid(), ProjectID = Guid.NewGuid(), Filters = new FilterSet(new CombinedFilter()), ReferenceDesign = new DesignOffset(Guid.NewGuid(), 1.5), Overrides = new OverrideParameters { TargetMachineSpeed = new MachineSpeedExtendedRecord(5, 50) } }; SimpleBinarizableInstanceTester.TestClass(argument, "Custom SpeedStatisticsArgument not same after round trip serialisation"); }
public void Test_TileRenderRequestArgument() { var argument = new TileRenderRequestArgument { ProjectID = Guid.NewGuid(), Filters = new FilterSet(new CombinedFilter(), new CombinedFilter()), ReferenceDesign = new DesignOffset(Guid.NewGuid(), 1.5), Mode = DisplayMode.Height, CoordsAreGrid = true, PixelsX = 100, PixelsY = 200, Extents = BoundingWorldExtent3D.Inverted(), VolumeType = VolumeComputationType.BetweenDesignAndFilter }; SimpleBinarizableInstanceTester.TestClass(argument, "Custom TileRenderRequestArgument not same after round trip serialisation"); }
public void Test_CellDatumRequestArgument_ApplicationService() { var argument = new CellDatumRequestArgument_ApplicationService { ProjectID = Guid.NewGuid(), Mode = DisplayMode.Height, CoordsAreGrid = false, Point = new XYZ(1.234, 5.678), Filters = new FilterSet(new CombinedFilter(), new CombinedFilter()), ReferenceDesign = new DesignOffset(), Overrides = new OverrideParameters { OverrideMachineCCV = true, OverridingMachineCCV = 123 } }; SimpleBinarizableInstanceTester.TestClass(argument, "Custom CellDatumRequestArgument_ApplicationService not same after round trip serialisation"); }
public void Test_CMVChangeStatisticsResponse() { var response = new CMVChangeStatisticsResponse() { 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 CMVChangeStatisticsResponse not same after round trip serialisation"); }
public void Test_StationOffsetReportRequestResponse_ApplicationService_WithMinimalContent() { var response = new StationOffsetReportRequestResponse_ApplicationService() { ResultStatus = RequestErrorStatus.OK, ReturnCode = ReportReturnCode.NoData, ReportType = ReportType.StationOffset, StationOffsetReportDataRowList = new List <StationOffsetReportDataRow_ApplicationService>() { new StationOffsetReportDataRow_ApplicationService() { } } }; SimpleBinarizableInstanceTester.TestClass(response, "Empty StationOffsetReportRequestResponse_ApplicationService not same after round trip serialisation"); }
public void WithData() { var projectUid = Guid.NewGuid(); var designUid = Guid.NewGuid(); var arg = new AlignmentDesignGeometryArgument { ProjectID = projectUid, AlignmentDesignID = designUid, ConvertArcsToPolyLines = true, ArcChordTolerance = 0.123 }; var result = SimpleBinarizableInstanceTester.TestClass(arg, "Custom AlignmentDesignGeometryArgument not same after round trip serialisation"); result.member.Should().BeEquivalentTo(arg); }
public void Test_MDPStatisticsArgument() { var argument = new MDPStatisticsArgument() { TRexNodeID = Guid.NewGuid(), ProjectID = Guid.NewGuid(), Filters = new FilterSet(new CombinedFilter()), ReferenceDesign = new DesignOffset(Guid.NewGuid(), 1.5), Overrides = new OverrideParameters { MDPRange = new MDPRangePercentageRecord(80, 120), OverrideMachineMDP = false, OverridingMachineMDP = 1000 } }; SimpleBinarizableInstanceTester.TestClass(argument, "Custom MDPStatisticsArgument not same after round trip serialisation"); }
public void Test_CellDatumRequestArgument_ClusterCompute() { var argument = new CellDatumRequestArgument_ClusterCompute { ProjectID = Guid.NewGuid(), Mode = DisplayMode.Height, NEECoords = new XYZ(1.234, 5.678), OTGCellX = 65125, OTGCellY = 28451, Filters = new FilterSet(new CombinedFilter(), new CombinedFilter()), ReferenceDesign = new DesignOffset(), Overrides = new OverrideParameters { OverrideMachineCCV = true, OverridingMachineCCV = 123 } }; SimpleBinarizableInstanceTester.TestClass(argument, "Custom CellDatumRequestArgument_ClusterCompute not same after round trip serialisation"); }