public void Test_TAGProcessor_ProcessEpochContext_WithValidPosition() { var SiteModel = new SiteModel(StorageMutability.Immutable); SiteModel.IgnoreInvalidPositions = false; var Machine = new Machine(); var SiteModelGridAggregator = new ServerSubGridTree(SiteModel.ID, StorageMutability.Mutable); var MachineTargetValueChangesAggregator = new ProductionEventLists(SiteModel, MachineConsts.kNullInternalSiteModelMachineIndex); TAGProcessor processor = new TAGProcessor(SiteModel, Machine, SiteModelGridAggregator, MachineTargetValueChangesAggregator); // Set the blade left and right tip locations to a trivial epoch, the epoch and do it again to trigger a swathing scan, then // check to see if it generated anything! Fence interpolationFence = new Fence(); interpolationFence.SetRectangleFence(0, 0, 1, 1); DateTime StartTime = DateTime.SpecifyKind(new DateTime(2000, 1, 1, 1, 1, 1), DateTimeKind.Utc); processor.DataLeft = new XYZ(0, 0, 5); processor.DataRight = new XYZ(1, 0, 5); processor.DataTime = StartTime; Assert.True(processor.ProcessEpochContext(), "ProcessEpochContext returned false in default TAGProcessor state (1)"); DateTime EndTime = DateTime.SpecifyKind(new DateTime(2000, 1, 1, 1, 1, 3), DateTimeKind.Utc); processor.DataLeft = new XYZ(0, 1, 5); processor.DataRight = new XYZ(1, 1, 5); processor.DataTime = EndTime; Assert.True(processor.ProcessEpochContext(), "ProcessEpochContext returned false in default TAGProcessor state (2)"); Assert.Equal(9, processor.ProcessedCellPassesCount); Assert.Equal(2, processor.ProcessedEpochCount); }
public void Test_TAGProcessor_ProcessEpochContext_WithoutValidTimestamp() { var SiteModel = new SiteModel(StorageMutability.Immutable); SiteModel.IgnoreInvalidPositions = false; var Machine = new Machine(); var SiteModelGridAggregator = new ServerSubGridTree(SiteModel.ID, StorageMutability.Mutable); var MachineTargetValueChangesAggregator = new ProductionEventLists(SiteModel, MachineConsts.kNullInternalSiteModelMachineIndex); TAGProcessor processor = new TAGProcessor(SiteModel, Machine, SiteModelGridAggregator, MachineTargetValueChangesAggregator); // Set the blade left and right tip locations to a trivial epoch, the epoch and do it again to trigger a swathing scan, then // check to see if it generated anything! Fence interpolationFence = new Fence(); interpolationFence.SetRectangleFence(0, 0, 1, 1); processor.DataLeft = new XYZ(0, 0, 5); processor.DataRight = new XYZ(1, 0, 5); Assert.False(processor.ProcessEpochContext(), "ProcessEpochContext returned true without a valid epoch timestamp"); }