Example #1
0
        public void PositionateAbsoluteToRightEdge()
        {
            var edge = new ToRightEdge();

            edge.Add(this.Left, null);
            edge.Positionate(WIDTH, HEIGHT);

            Assert.IsNotNull(edge.Left.Position);
            Assert.AreEqual(edge.Left, this.Left);
            Assert.AreEqual(edge.Left.Position.Value.X + edge.Left.Width, WIDTH);
        }
Example #2
0
        public void PositionateLeftRelativeToRightEdge()
        {
            var rightPosition = new Vector2(WIDTH / 2, HEIGHT / 2);
            var leftPosition  = rightPosition + new Vector2(this.Left.Width, 0);

            var edge = new ToRightEdge();

            edge.Add(this.Left, this.Right);
            this.Right.Position = rightPosition;

            AssertEdgeBasic(edge, leftPosition, rightPosition);
            AssertEdgeVerticesEqualDimensions(edge);
        }