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

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

            Assert.AreEqual(expectedArea, actualPaperTriangle.GetArea());
        }
Exemplo n.º 3
0
        public void Test_GetArea()
        {
            var sidesPaperTriangle = new List <double> {
                6, 8, 6
            };

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

            Assert.AreEqual(result, actualResult, 0.000001);
        }
Exemplo n.º 4
0
        public void GetArea_NewRectangle_GetArea()
        {
            var actual = 3.799671038392666;

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

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