Beispiel #1
0
        public void GetPerimeterTest()
        {
            // Arange
            double[]      v             = { 2 };
            SquareFigure  squareFigure2 = new SquareFigure(v);
            FigureBuilder squareBuilder = new SquareBuilder("SquareFigure");
            Figures       squareFigure1 = squareBuilder.Create(2);
            double        expected      = 8;
            //Act
            var result = squareFigure2.GetPerimeter();

            // Assert
            Assert.AreEqual(result, expected);
        }
Beispiel #2
0
        public void ToStringTest()
        {
            // Arange
            double[]     v            = { 2 };
            SquareFigure squareFigure = new SquareFigure(v);
            string       str          = "Квадрат с площадью " + squareFigure.GetArea() + " и периметром " + squareFigure.GetPerimeter();
            string       expected     = str;
            //Act
            string result = squareFigure.ToString();

            // Assert
            Assert.AreEqual(result, expected);
        }