Ejemplo n.º 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);
        }
Ejemplo n.º 2
0
        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());
        }