GetNewSquare() 공개 정적인 메소드

public static GetNewSquare ( ) : Rectangle
리턴 Rectangle
예제 #1
0
        public void Can_calculate_area_of_a_sqaure()
        {
            const int expectedArea = 100;
            var       square       = RectangleFactory.GetNewSquare();

            square.setWidth(10);
            square.setHeight(10);
            Assert.That(square.GetArea(), Is.EqualTo(expectedArea));
        }
예제 #2
0
        public void Is_A_rectangle_a_square()
        {
            const int expectedArea = 50;
            var       rectangle    = RectangleFactory.GetNewSquare() as Square;

            rectangle.setWidth(5);
            rectangle.setHeight(10);
            Assert.That(rectangle.GetArea(), Is.EqualTo(expectedArea));
        }