Example #1
0
            public void ShouldReturnCorrectPositionForEvenWidth()
            {
                // Top left = (0,0)
                // Dimensions = 150x150
                var rectangle = new Rectangle(0, 0, 150, 150);

                var expectedTopHinge = new Position().WithX(75).WithY(0);
                var actualTopHinge   = new PanelHinges(rectangle, Rotation.None).Top;

                actualTopHinge.ShouldBeEquivalentTo(expectedTopHinge);
            }
Example #2
0
            public void ShouldReturnCorrectPositionForUnevenHeight()
            {
                // Top left = (0,0)
                // Dimensions = 15x15
                var rectangle = new Rectangle(0, 0, 15, 15);

                var expectedLeftHinge = new Position().WithX(0).WithY(7);
                var actualLeftHinge   = new PanelHinges(rectangle, Rotation.None).Left;

                actualLeftHinge.ShouldBeEquivalentTo(expectedLeftHinge);
            }
Example #3
0
            public void ShouldReturnCorrectPositionForUnevenWidth()
            {
                // Top left = (0,0)
                // Dimensions = 15x15
                var rectangle = new Rectangle(0, 0, 15, 15);

                var expectedBottomHinge = new Position().WithX(7).WithY(15);
                var actualBottomHinge   = new PanelHinges(rectangle, Rotation.None).Bottom;

                actualBottomHinge.ShouldBeEquivalentTo(expectedBottomHinge);
            }