public void Clear() { var rec = new SubGridCellPassDataCCAEntryRecord(1, 2, 3, 4); rec.Clear(); rec.Should().BeEquivalentTo(SubGridCellPassDataCCAEntryRecord.NullValue); }
public void Creation2() { var rec = new SubGridCellPassDataCCAEntryRecord(1, 2, 3, 4); rec.MeasuredCCA.Should().Be(1); rec.TargetCCA.Should().Be(2); rec.PreviousMeasuredCCA.Should().Be(3); rec.PreviousTargetCCA.Should().Be(4); }
public void Test_CCASummaryPalette_ChooseColour_Compacted() { var palette = new CCASummaryPalette(); palette.Should().NotBeNull(); var ccaCellData = new SubGridCellPassDataCCAEntryRecord(); palette.ChooseColour(ccaCellData).Should().Be(palette.CompactedColour); }
public void Test_NullCells() { var cell = new SubGridCellPassDataCCAEntryRecord(); cell.Clear(); var clientGrid = ClientLeafSubGridFactoryFactory.CreateClientSubGridFactory().GetSubGrid(GridDataType.CCA) as ClientCCALeafSubGrid; SubGridUtilities.SubGridDimensionalIterator((x, y) => Assert.True(clientGrid.Cells[x, y].Equals(cell))); }
public void Creation() { var rec = new SubGridCellPassDataCCAEntryRecord(); rec.Clear(); Assert.True(rec.MeasuredCCA == CellPassConsts.NullCCA); Assert.True(rec.TargetCCA == CellPassConsts.NullCCATarget); Assert.True(rec.PreviousMeasuredCCA == CellPassConsts.NullCCA); Assert.True(rec.PreviousTargetCCA == CellPassConsts.NullCCATarget); }
public Color ChooseColour(SubGridCellPassDataCCAEntryRecord ccaCellData) { if (ccaCellData.IsUndercompacted) { return(UndercompactedColour); } if (ccaCellData.IsOvercompacted) { return(OvercompactedColour); } return(CompactedColour); }
public void BinaryReaderWriter() { var instance = new SubGridCellPassDataCCAEntryRecord(1, 2, 3, 4); // 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 SubGridCellPassDataCCAEntryRecord(); instance2.Read(new BinaryReader(writer.BaseStream as MemoryStream)); instance.Should().BeEquivalentTo(instance2); }
public void IndicativeSizeInBytes() { SubGridCellPassDataCCAEntryRecord.IndicativeSizeInBytes().Should().Be(4 * sizeof(byte) + sizeof(byte)); }