Ejemplo n.º 1
0
        public void CheckTriangle(float sideA, float sideB, float sideC, float expectArea, float expectPerim)
        {
            Triangle triangle = new TrianglePaper(sideA, sideB, sideC);

            Assert.AreEqual(expectArea, triangle.GetArea(), 0.00001f);

            Assert.AreEqual(expectPerim, triangle.GetPerimeter(), 0.00001f);
        }
Ejemplo n.º 2
0
        public void TestGetArea()
        {
            var sidesList = new List <double> {
                3, 2, 3
            };
            var    rectangle    = new TrianglePaper(sidesList, Color.Red);
            double result       = rectangle.GetArea();
            double actualResult = 2.828;

            Assert.AreEqual(result, actualResult, 0.001);
        }