public void Test_GetPerimeter(double actualResult, params double[] sides)
        {
            var    paperTriangle = new PaperTriangle(sides, Color.Red);
            double result        = paperTriangle.GetPerimeter();

            Assert.AreEqual(result, actualResult, 0.000001);
        }
        public void GetPerimeter_PositiveTestResult(double triangleFirstSide, double triangleSecondSide, double triangleThirdSide, Colors color, double expectedPerimeter)
        {
            PaperTriangle actualPaperTriangle = new PaperTriangle(new List <double> {
                triangleFirstSide, triangleSecondSide, triangleThirdSide
            }, color);

            Assert.AreEqual(expectedPerimeter, actualPaperTriangle.GetPerimeter());
        }
示例#3
0
        public void Test_GetPerimeter()
        {
            var sidesPaperTriangle = new List <double> {
                6, 8, 6
            };

            var    paperTriangle = new PaperTriangle(sidesPaperTriangle, Color.Red);
            double result        = paperTriangle.GetPerimeter();
            double actualResult  = 20;

            Assert.AreEqual(result, actualResult, 0.000001);
        }
        public void GetPerimeter_NewRectangle_GetPerimeter()
        {
            var actual = 11;

            // act
            var expected = new PaperTriangle(new List <double> {
                2, 4, 5
            }, Color.Black);

            // assert;
            Assert.Equal(expected.GetPerimeter(), actual);
        }