public void GetAreaTest_1_2_3_Equal_0()
        {
            // Arrange
            triangle.SideA = 1;
            triangle.SideB = 2;
            triangle.SideC = 3;

            double expected = 0;

            // Act
            double actual = triangle.GetArea();

            // Assert
            Assert.AreEqual(expected, actual, 0.01);
        }
Esempio n. 2
0
        public void TriangleFigure_String_String()
        {
            // Arange
            double[]       v = { 3, 4, 4 };
            TriangleFigure triangleFigure2  = new TriangleFigure(v);
            FigureBuilder  triangleBuilder1 = new TriangleBuilder("TriangleFigure");
            Figures        triangleFigure1  = triangleBuilder1.Create(3, 4, 4);
            string         expected         = "Треугольник с площадью " + triangleFigure2.GetArea() + " и периметром " + triangleFigure2.GetPerimeter();
            //Act
            var result = triangleFigure1.ToString();

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