예제 #1
0
        public void Clear()
        {
            var rec = new SubGridCellPassDataCCAEntryRecord(1, 2, 3, 4);

            rec.Clear();

            rec.Should().BeEquivalentTo(SubGridCellPassDataCCAEntryRecord.NullValue);
        }
예제 #2
0
        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);
        }
예제 #3
0
        public void Test_CCASummaryPalette_ChooseColour_Compacted()
        {
            var palette = new CCASummaryPalette();

            palette.Should().NotBeNull();

            var ccaCellData = new SubGridCellPassDataCCAEntryRecord();

            palette.ChooseColour(ccaCellData).Should().Be(palette.CompactedColour);
        }
예제 #4
0
        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)));
        }
예제 #5
0
        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);
        }
예제 #6
0
        public Color ChooseColour(SubGridCellPassDataCCAEntryRecord ccaCellData)
        {
            if (ccaCellData.IsUndercompacted)
            {
                return(UndercompactedColour);
            }

            if (ccaCellData.IsOvercompacted)
            {
                return(OvercompactedColour);
            }

            return(CompactedColour);
        }
예제 #7
0
        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);
        }
예제 #8
0
 public void IndicativeSizeInBytes()
 {
     SubGridCellPassDataCCAEntryRecord.IndicativeSizeInBytes().Should().Be(4 * sizeof(byte) + sizeof(byte));
 }