public void Test_MDPSummaryPalette_ChooseColour_MachineTarget() { var palette = new MDPSummaryPalette(); palette.Should().NotBeNull(); palette.UseMachineTargetMDP = true; palette.UseMachineTargetMDP.Should().Be(true); var data = new SubGridCellPassDataMDPEntryRecord(MEASURED_MDP, TARGET_MDP); var colors = new[] { palette.BelowMDPTargetRangeColour, palette.BelowMDPTargetRangeColour, palette.BelowMDPTargetRangeColour, palette.BelowMDPTargetRangeColour, palette.WithinMDPTargetRangeColour, palette.AboveMDPTargetRangeColour, palette.AboveMDPTargetRangeColour }; for (var i = 0; i < colors.Length; i++) { data.MeasuredMDP = (short)(MEASURED_MDP + i * MDP_INCREMENT); palette.ChooseColour(data.MeasuredMDP, data.TargetMDP).Should().Be(colors[i]); } }
public void Creation2() { var rec = new SubGridCellPassDataMDPEntryRecord(1, 2); rec.MeasuredMDP.Should().Be(1); rec.TargetMDP.Should().Be(2); }
public void Clear() { var rec = new SubGridCellPassDataMDPEntryRecord(1, 2); rec.Clear(); rec.Should().BeEquivalentTo(SubGridCellPassDataMDPEntryRecord.NullValue); }
public void Test_SubGridCellPassDataMDPEntryRecord_Creation() { SubGridCellPassDataMDPEntryRecord rec = new SubGridCellPassDataMDPEntryRecord(); rec.Clear(); Assert.True(rec.MeasuredMDP == CellPassConsts.NullMDP); Assert.True(rec.TargetMDP == CellPassConsts.NullMDP); }
public void Test_NullCells() { var cell = new SubGridCellPassDataMDPEntryRecord(); cell.Clear(); var clientGrid = ClientLeafSubGridFactoryFactory.CreateClientSubGridFactory().GetSubGrid(GridDataType.MDP) as ClientMDPLeafSubGrid; SubGridUtilities.SubGridDimensionalIterator((x, y) => Assert.True(clientGrid.Cells[x, y].Equals(cell))); }
public void BinaryReaderWriter() { var instance = new SubGridCellPassDataMDPEntryRecord(1, 2); // Test using standard Read()/Write() var writer = new BinaryWriter(new MemoryStream(Consts.TREX_DEFAULT_MEMORY_STREAM_CAPACITY_ON_CREATION)); instance.Write(writer); (writer.BaseStream as MemoryStream).Position = 0; var instance2 = new SubGridCellPassDataMDPEntryRecord(); instance2.Read(new BinaryReader(writer.BaseStream as MemoryStream)); instance.Should().BeEquivalentTo(instance2); }
public void Test_MDPSummaryPalette_ChooseColour_NullOverrideTarget() { var palette = new MDPSummaryPalette(); palette.Should().NotBeNull(); palette.AbsoluteTargetMDP = CellPassConsts.NullMDP; palette.AbsoluteTargetMDP.Should().Be(CellPassConsts.NullMDP); var data = new SubGridCellPassDataMDPEntryRecord(MEASURED_MDP, TARGET_MDP); var colors = new[] { Color.Empty, Color.Empty, Color.Empty, Color.Empty, Color.Empty, Color.Empty, Color.Empty }; for (var i = 0; i < colors.Length; i++) { data.MeasuredMDP = (short)(MEASURED_MDP + i * MDP_INCREMENT); palette.ChooseColour(data.MeasuredMDP, TARGET_MDP).Should().Be(colors[i]); } }
public void IndicativeSizeInBytes() { SubGridCellPassDataMDPEntryRecord.IndicativeSizeInBytes().Should().Be(2 * sizeof(short) + sizeof(byte)); }