public async Task CSVExportRequest_Execute_ExceedsLimit() { DILoggingFixture.SetMaxExportRowsConfig(1); AddApplicationGridRouting(); AddClusterComputeGridRouting(); var tempFileName = MockS3FileTransfer_UploadToBucket(); var siteModel = DITAGFileAndSubGridRequestsWithIgniteFixture.NewEmptyModel(); var request = new CSVExportRequest(); var baseDate = DateTime.SpecifyKind(new DateTime(2000, 1, 1, 1, 0, 0, 0), DateTimeKind.Utc); var cellPasses = new CellPass[SubGridTreeConsts.SubGridTreeDimension, SubGridTreeConsts.SubGridTreeDimension][]; SubGridUtilities.SubGridDimensionalIterator((x, y) => { cellPasses[x, y] = new[] { new CellPass { Time = baseDate, Height = 1.0f } }; }); DITAGFileAndSubGridRequestsFixture.AddSingleSubGridWithPasses(siteModel, SubGridTreeConsts.DefaultIndexOriginOffset, SubGridTreeConsts.DefaultIndexOriginOffset, cellPasses); var response = await request.ExecuteAsync(SimpleCSVExportRequestArgument(siteModel.ID)); response.Should().NotBeNull(); response.ResultStatus.Should().Be(RequestErrorStatus.ExportExceededRowLimit); CleanupMockedFile(tempFileName, siteModel.ID); }
public CSVExportRequestTests(DITAGFileAndSubGridRequestsWithIgniteFixture fixture) { fixture.ResetDynamicMockedIgniteContent(); fixture.SetupFixture(); DILoggingFixture.SetMaxExportRowsConfig(Consts.DEFAULT_MAX_EXPORT_ROWS); }
public void RowCountLimit_AllPassesMultiSubGrids(int maxExportRows) { DILoggingFixture.SetMaxExportRowsConfig(maxExportRows); var requestedSubGrids = GetSubGrids(CoordType.Northeast, OutputTypes.PassCountAllPasses, false, out var requestArgument, out _); var subGridProcessor = new CSVExportSubGridProcessor(requestArgument); var rows = new List <string>(); foreach (var subGrid in requestedSubGrids) { rows.AddRange(subGridProcessor.ProcessSubGrid(subGrid as ClientCellProfileAllPassesLeafSubgrid)); } if (maxExportRows <= 5051) // 5051 is the number of rows we could potentially get from this set { rows.Count.Should().Be(maxExportRows); } else { rows.Count.Should().BeLessOrEqualTo(maxExportRows); } }
public void VetaFinalPass_NorthingEasting() { DILoggingFixture.SetMaxExportRowsConfig(100); var requestedSubGrids = GetSubGrids(CoordType.Northeast, OutputTypes.VedaFinalPass, false, out var requestArgument, out _); var subGridProcessor = new CSVExportSubGridProcessor(requestArgument); var rows = subGridProcessor.ProcessSubGrid(requestedSubGrids[0] as ClientCellProfileLeafSubgrid); rows.Count.Should().Be(100); rows[0].Should().Be(@"2019-Jan-23 00:22:09.993,808532.750m,376734.110m,68.631m,1,0,Site Extended (Preliminary) 180302 EW,""Unknown"",34.2km/h,RTK Fixed,Medium (0.050m),?,1,1,?,?,?,?,?,?,?,?,?,?,?"); }
public void PassCountLastPassDBase() { DILoggingFixture.SetMaxExportRowsConfig(1000); var requestedSubGrids = GetSubGrids(CoordType.Northeast, OutputTypes.PassCountLastPass, true, out var requestArgument, out _); var subGridProcessor = new CSVExportSubGridProcessor(requestArgument); var rows = subGridProcessor.ProcessSubGrid(requestedSubGrids[0] as ClientCellProfileLeafSubgrid); rows.Count.Should().Be(226); rows[0].Should().Be(@"2019/Jan/23 00:22:09.993,808532.750,376734.110,68.631,1,0,Site Extended (Preliminary) 180302 EW,""Unknown"",34.2,RTK Fixed,Medium (0.050),,1,1,,,,,,,,,,,"); }
public void PassCountLastPassNotDbaseWithLatLong() { DILoggingFixture.SetMaxExportRowsConfig(1000); var requestedSubGrids = GetSubGrids(CoordType.LatLon, OutputTypes.PassCountLastPass, false, out var requestArgument, out _); var subGridProcessor = new CSVExportSubGridProcessor(requestArgument); var rows = subGridProcessor.ProcessSubGrid(requestedSubGrids[0] as ClientCellProfileLeafSubgrid); rows.Count.Should().Be(226); rows[0].Should().Be(@"2019/Jan/23 00:22:10.033,808,525.440m,376,730.880m,68.631m,1,0,Site Extended (Preliminary) 180302 EW,""Unknown"",34.2km/h,RTK Fixed,Medium (0.050m),?,1,1,?,?,?,?,?,?,?,?,?,?,?"); }
public void VetaFinalPass_LatLong() { DILoggingFixture.SetMaxExportRowsConfig(10); //todo when this test is enabled, you'll need to duplicate some of the "Dimensions2018-CaseMachine" tag files // from their outer location of TRex\tests\netstandard\TAGFiles.Tests\TestData\TAGFiles // to TRex\tests\netstandard\VSS.TRex.Tests\TestData\TAGFiles var requestedSubGrids = GetSubGrids(CoordType.LatLon, OutputTypes.VedaFinalPass, false, out var requestArgument, out var siteModel, "Dimensions2018-CaseMachine"); DITAGFileAndSubGridRequestsFixture.AddCSIBToSiteModel(ref siteModel, TestCommonConsts.DIMENSIONS_2012_DC_CSIB); var subGridProcessor = new CSVExportSubGridProcessor(requestArgument); var rows = subGridProcessor.ProcessSubGrid(requestedSubGrids[0] as ClientCellProfileLeafSubgrid); rows.Count.Should().Be(8); rows[0].Should().Be(@"2012-Nov-05 19:44:47.459,1174.870m,2869.770m,599.220m,2,0,Trimble Road with Ref Surfaces v2,""Unknown"",7.4km/h,Not_Applicable,Fine (0.000m),?,2,1,?,?,?,?,?,?,?,?,?,?,?"); }
public void RowCountLimit_FinalPass(int maxExportRows) { DILoggingFixture.SetMaxExportRowsConfig(maxExportRows); var requestedSubGrids = GetSubGrids(CoordType.Northeast, OutputTypes.VedaFinalPass, false, out var requestArgument, out _); var subGridProcessor = new CSVExportSubGridProcessor(requestArgument); var rows = subGridProcessor.ProcessSubGrid(requestedSubGrids[0] as ClientCellProfileLeafSubgrid); if (maxExportRows <= 226) // 226 is the number of rows we could potentially get from this set { rows.Count.Should().Be(maxExportRows); } else { rows.Count.Should().BeLessOrEqualTo(maxExportRows); } }
public async Task CellProfile_FullDataContingent() { DILoggingFixture.SetMaxExportRowsConfig(1); SetupSiteAndRequestArgument(CoordType.Northeast, OutputTypes.VedaFinalPass, false, "ElevationMappingMode-KettlewellDrive", out var requestArgument); requestArgument.MappedMachines = new List <CSVExportMappedMachine>() { new CSVExportMappedMachine() { InternalSiteModelMachineIndex = 2, Name = "The machine Name" } }; var clientGrid = SetupProfileSampleCell(); var subGridProcessor = new CSVExportSubGridProcessor(requestArgument); var rows = subGridProcessor.ProcessSubGrid(clientGrid); rows.Count.Should().Be(1); rows[0].Should().Be(@"2019-Mar-14 23:45:00.000,0.170m,0.170m,6509.000m,1,34,Full Site (Kettlewell Drive 171219) Earthworks,""The machine Name"",1,188.0km/h,Float,Coarse (0.300m),5,3,2,90.1,85.0,13.0,11.0,11.1,96.0Hz,45.60mm,45.000m,Forward_2,On,104.0°C"); }
public void CellPasses_IncludesHalfPasses() { DILoggingFixture.SetMaxExportRowsConfig(10); SetupSiteAndRequestArgument(CoordType.Northeast, OutputTypes.PassCountAllPasses, false, "ElevationMappingMode-KettlewellDrive", out var requestArgument); requestArgument.MappedMachines = new List <CSVExportMappedMachine>() { new CSVExportMappedMachine() { InternalSiteModelMachineIndex = 2, Name = "The machine Name" } }; var clientGrid = SetupProfileAllPassesSampleCell(); var subGridProcessor = new CSVExportSubGridProcessor(requestArgument); var rows = subGridProcessor.ProcessSubGrid(clientGrid); rows.Count.Should().Be(3); rows[0].Should().Be(@"2019/Apr/15 00:00:00.000,0.170m,0.170m,555.000m,1,0,?,""The machine Name"",23.9km/h,Old Position,Fine (0.000m),5,3,5,77.7,0.8,0.0,0.0,0.0,0.0Hz,0.00mm,0.000m,Neutral,Off,0.0°C"); rows[1].Should().Be(@"2019/May/16 00:00:00.000,0.170m,0.170m,20.000m,1,0,?,""Unknown"",1.6km/h,Old Position,Fine (0.000m),2,1,1,4.4,6.6,0.0,0.0,0.0,0.0Hz,0.00mm,0.000m,Neutral,Off,0.0°C"); rows[2].Should().Be(@"2019/Apr/15 00:00:00.000,0.170m,0.170m,565.000m,1,0,?,""The machine Name"",27.9km/h,Old Position,Fine (0.000m),5,3,5,33.3,8.8,0.0,0.0,0.0,0.0Hz,0.00mm,0.000m,Neutral,Off,0.0°C"); }
public CSVExportSubGridProcessorTests() { DILoggingFixture.SetMaxExportRowsConfig(Consts.DEFAULT_MAX_EXPORT_ROWS); }