Exemplo 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);
        }
Exemplo n.º 2
0
        public void TestGetPerimeter()
        {
            var sidesList = new List <double> {
                1, 2, 3
            };
            var    rectangle    = new TrianglePaper(sidesList, Color.Red);
            double result       = rectangle.GetPerimeter();
            double actualResult = 6;

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