Exemplo n.º 1
0
        public void Expand()
        {
            var bound = new BoundingIntegerExtent2D(0, 0, 100, 100);

            bound.Expand(1);
            bound.Should().BeEquivalentTo(new BoundingIntegerExtent2D(-1, -1, 101, 101));
            bound.Expand(-1);
            bound.Should().BeEquivalentTo(new BoundingIntegerExtent2D(0, 0, 100, 100));
        }
Exemplo n.º 2
0
        public void Offset()
        {
            var bound = new BoundingIntegerExtent2D(0, 0, 100, 100);

            bound.Offset(1, 2);
            bound.Should().BeEquivalentTo(new BoundingIntegerExtent2D(1, 2, 101, 102));

            bound.Offset(-1, -2);
            bound.Should().BeEquivalentTo(new BoundingIntegerExtent2D(0, 0, 100, 100));
        }
Exemplo n.º 3
0
        public void Include()
        {
            var bound = new BoundingIntegerExtent2D(0, 0, 0, 0);

            bound.Include(0, 1000);
            bound.Should().BeEquivalentTo(new BoundingIntegerExtent2D(0, 0, 0, 1000));
            bound.Include(1000, 0);
            bound.Should().BeEquivalentTo(new BoundingIntegerExtent2D(0, 0, 1000, 1000));
            bound.Include(0, -1000);
            bound.Should().BeEquivalentTo(new BoundingIntegerExtent2D(0, -1000, 1000, 1000));
            bound.Include(-1000, 0);
            bound.Should().BeEquivalentTo(new BoundingIntegerExtent2D(-1000, -1000, 1000, 1000));
        }
Exemplo n.º 4
0
        public void Inverted()
        {
            var bound = new BoundingIntegerExtent2D(0, 0, 100, 100);

            bound.SetInverted();

            bound.Should().BeEquivalentTo(new BoundingIntegerExtent2D(int.MaxValue, int.MaxValue, int.MinValue, int.MinValue));
        }
Exemplo n.º 5
0
        public void Assign()
        {
            var bound = new BoundingIntegerExtent2D(1, 1, 100, 100);

            var bound2 = new BoundingIntegerExtent2D();

            bound2.Assign(bound);

            bound2.Should().BeEquivalentTo(bound);
        }