Пример #1
0
        public void Test_Equals()
        {
            var bound  = new BoundingIntegerExtent2D(0, 0, 100, 100);
            var bound2 = new BoundingIntegerExtent2D(0, 0, 100, 100);
            var bound3 = new BoundingIntegerExtent2D(0, 0, 101, 101);

            bound.Equals((object)bound2).Should().BeTrue();
            bound.Equals((object)bound3).Should().BeFalse();

            bound.Equals(bound2).Should().BeTrue();
            bound.Equals(bound3).Should().BeFalse();
        }
Пример #2
0
        public void Test_SubGridTreeBitmapSubGridBitsTests_ComputeCellsExtents()
        {
            // Test extents for empty, full and arbitrary masks
            SubGridTreeBitmapSubGridBits bits = new SubGridTreeBitmapSubGridBits(SubGridBitsCreationOptions.Filled);

            BoundingIntegerExtent2D boundsFull = bits.ComputeCellsExtents();

            Assert.True(boundsFull.Equals(new BoundingIntegerExtent2D(0, 0, SubGridTreeConsts.SubGridTreeDimensionMinus1, SubGridTreeConsts.SubGridTreeDimensionMinus1)),
                        "ComputeCellsExtents is incorrect for full grid");

            bits.Clear();
            BoundingIntegerExtent2D boundsClear = bits.ComputeCellsExtents();

            Assert.False(boundsClear.IsValidExtent, "ComputeCellsExtents is incorrect for clear grid");

            bits.SetBit(1, 1);
            BoundingIntegerExtent2D bounds11 = bits.ComputeCellsExtents();

            Assert.True(bounds11.Equals(new BoundingIntegerExtent2D(1, 1, 1, 1)), "ComputeCellsExtents is incorrect for grid with bit set at (1, 1)");
        }