Beispiel #1
0
        public void TestThatCreateRectangleCalculatesCorrectOutlineWithOneThickness(int startX, int startY, int endX, int endY)
        {
            RectangleTool tool = new RectangleTool();

            var outline = tool.CreateRectangle(new Coordinates(startX, startY),
                                               new Coordinates(endX, endY), 1);

            int expectedBorderPoints = (endX - startX) * 2 + (endY - startX) * 2;

            Assert.Equal(expectedBorderPoints, outline.Length);
        }
        public void TestThatCreateRectangleCalculatesCorrectOutlineWithOneThickness(int startX, int startY, int endX, int endY)
        {
            RectangleTool tool = new RectangleTool();

            System.Collections.Generic.IEnumerable <Coordinates> outline = tool.CreateRectangle(
                new Coordinates(startX, startY),
                new Coordinates(endX, endY),
                1);

            int expectedBorderPoints = ((endX - startX) * 2) + ((endY - startX) * 2);

            Assert.Equal(expectedBorderPoints, outline.Count());
        }