Ejemplo n.º 1
0
        public void Test_CSVExportRequestArgument_WithContent()
        {
            var request = new CSVExportRequestArgument
                          (
                Guid.NewGuid(),
                new FilterSet(new CombinedFilter()),
                "the filename",
                CoordType.LatLon,
                OutputTypes.PassCountAllPasses,
                new CSVExportUserPreferences(),
                new List <CSVExportMappedMachine>()
            {
                new CSVExportMappedMachine()
                {
                    Uid = Guid.NewGuid(), InternalSiteModelMachineIndex = 0, Name = "Machine 1"
                },
                new CSVExportMappedMachine()
                {
                    Uid = Guid.NewGuid(), InternalSiteModelMachineIndex = 1, Name = "Machine 2"
                },
                new CSVExportMappedMachine()
                {
                    Uid = Guid.NewGuid(), InternalSiteModelMachineIndex = 2, Name = "Machine 3"
                }
            }, false, false
                          );

            SimpleBinarizableInstanceTester.TestClass(request, "Empty CSVExportRequestArgument not same after round trip serialization");
        }
Ejemplo n.º 2
0
        public void Test_StationOffsetReportRequestResponse_ApplicationService_WithContent()
        {
            double station = 1;
            var    offsets = new List <StationOffsetRow>()
            {
                new StationOffsetRow()
                {
                    Northing = 1, Easting = 2, Elevation = 4, Cmv = 5, CutFill = 6, Mdp = 7, PassCount = 8, Temperature = 9
                }
            }
            ;

            var response = new StationOffsetReportRequestResponse_ApplicationService()
            {
                ResultStatus = RequestErrorStatus.OK,
                ReturnCode   = ReportReturnCode.NoData,
                ReportType   = ReportType.StationOffset,
                StationOffsetReportDataRowList = new List <StationOffsetReportDataRow_ApplicationService>()
                {
                    new StationOffsetReportDataRow_ApplicationService(station, offsets)
                    {
                    }
                }
            };

            SimpleBinarizableInstanceTester.TestClass(response, "Empty StationOffsetReportRequestResponse_ApplicationService not same after round trip serialisation");
        }
Ejemplo n.º 3
0
        public void Test_PatchRequestResponse()
        {
            var response = new PatchRequestResponse()
            {
                ResultStatus = RequestErrorStatus.OK,
                TotalNumberOfPagesToCoverFilteredData = 1000,
                SubGrids = new List <IClientLeafSubGrid>()
            };

            var cmvSubGrid = new ClientCMVLeafSubGrid();

            cmvSubGrid.FillWithTestPattern();
            response.SubGrids.Add(cmvSubGrid);

            var passCountSubGrid = new ClientPassCountLeafSubGrid();

            passCountSubGrid.FillWithTestPattern();
            response.SubGrids.Add(passCountSubGrid);

            var mdpSubGrid = new ClientMDPLeafSubGrid();

            mdpSubGrid.FillWithTestPattern();
            response.SubGrids.Add(mdpSubGrid);


            SimpleBinarizableInstanceTester.TestClass(response, "Custom PatchRequestResponse not same after round trip serialisation");
        }
Ejemplo n.º 4
0
        public void Test_GriddedReportRequestArgument_WithContent()
        {
            var request = new GriddedReportRequestArgument()
            {
                ProjectID         = Guid.NewGuid(),
                Filters           = new FilterSet(new CombinedFilter()),
                ReferenceDesign   = new DesignOffset(Guid.NewGuid(), 1.5),
                ReportElevation   = true,
                ReportCmv         = true,
                ReportMdp         = true,
                ReportPassCount   = true,
                ReportTemperature = true,
                ReportCutFill     = false,
                GridInterval      = 1.5,
                GridReportOption  = GridReportOption.Direction,
                StartNorthing     = 808000,
                StartEasting      = 400000,
                EndNorthing       = 809000,
                EndEasting        = 400100,
                Azimuth           = 4.6,
                Overrides         = new OverrideParameters {
                    OverrideMachineCCV = true, OverridingMachineCCV = 45
                }
            };

            SimpleBinarizableInstanceTester.TestClass(request, "Empty GriddedReportRequestArgument not same after round trip serialisation");
        }
Ejemplo n.º 5
0
        public void Test_CSVExportRequestArgument_Empty()
        {
            var request = new CSVExportRequestArgument()
            {
            };

            SimpleBinarizableInstanceTester.TestClass(request, "Empty CSVExportRequestArgument not same after round trip serialization");
        }
Ejemplo n.º 6
0
        public void Test_StationOffsetReportRequestArgument_ClusterCompute_Empty()
        {
            var request = new StationOffsetReportRequestArgument_ClusterCompute()
            {
            };

            SimpleBinarizableInstanceTester.TestClass(request, "Empty StationOffsetReportRequestArgument_ClusterCompute not same after round trip serialisation");
        }
Ejemplo n.º 7
0
        public void Test_AlignmentDesignFilterBoundaryResponse_Polygon()
        {
            var response = new AlignmentDesignFilterBoundaryRequest
            {
            };

            SimpleBinarizableInstanceTester.TestClass(response, "Custom AlignmentDesignFilterBoundaryRequest not same after round trip serialisation");
        }
Ejemplo n.º 8
0
        public void Test_CellDatumResponse_ClusterCompute_MinimalContent()
        {
            var response = new CellDatumResponse_ClusterCompute
            {
                ReturnCode = CellDatumReturnCode.UnexpectedError
            };

            SimpleBinarizableInstanceTester.TestClass(response, "Minimal CellDatumResponse_ClusterCompute not same after round trip serialisation");
        }
Ejemplo n.º 9
0
        public void Test_StationOffsetReportRequestResponse_ApplicationService_Empty()
        {
            var response = new StationOffsetReportRequestResponse_ApplicationService()
            {
                ReturnCode = ReportReturnCode.NoData
            };

            SimpleBinarizableInstanceTester.TestClass(response, "Empty StationOffsetReportRequestResponse_ApplicationService not same after round trip serialisation");
        }
Ejemplo n.º 10
0
        public void Test_TINSurfaceRequestResponse_ErrorResult()
        {
            var result = new TINSurfaceResult
            {
                ResultStatus = RequestErrorStatus.AbortedDueToPipelineTimeout,
                data         = null
            };

            SimpleBinarizableInstanceTester.TestClass(result);
        }
Ejemplo n.º 11
0
        public void Test_OverrideEventResponse_WithContent()
        {
            var response = new OverrideEventResponse
            {
                Message = "This is an error message",
                Success = false
            };

            SimpleBinarizableInstanceTester.TestClass(response, "Custom OverrideEventResponse not same after round trip serialisation");
        }
Ejemplo n.º 12
0
        public void Test_TileRenderResponse_Core2()
        {
            var response = new TileRenderResponse
            {
                TileBitmapData = new byte[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 },
                ResultStatus   = Types.RequestErrorStatus.OK
            };

            SimpleBinarizableInstanceTester.TestClass(response, "Custom TileRenderResponse_Core2 not same after round trip serialisation");
        }
Ejemplo n.º 13
0
        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");
        }
Ejemplo n.º 14
0
        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");
        }
Ejemplo n.º 15
0
        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");
        }
Ejemplo n.º 16
0
        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);
        }
Ejemplo n.º 17
0
        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");
        }
Ejemplo n.º 18
0
        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);
        }
Ejemplo n.º 19
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");
        }
Ejemplo n.º 20
0
        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));
        }
Ejemplo n.º 21
0
        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);
        }
Ejemplo n.º 22
0
        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");
        }
Ejemplo n.º 23
0
        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);
        }
Ejemplo n.º 24
0
        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");
        }
Ejemplo n.º 25
0
        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");
        }
Ejemplo n.º 26
0
        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");
        }
Ejemplo n.º 27
0
        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");
        }
Ejemplo n.º 28
0
        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");
        }
Ejemplo n.º 29
0
        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);
        }
Ejemplo n.º 30
0
        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");
        }