Beispiel #1
0
        public void PerimeterCalculator_WithFourPoints()
        {
            double actualPerimeter = new Figure(p1, p2, p3, p4).PerimeterCalculator();
            double expectedPerimeter = 16;

            Assert.AreEqual(expectedPerimeter, actualPerimeter, 0.01);
        }
Beispiel #2
0
        public void PerimeterCalculator_WithThreePoints()
        {
            double actualPerimeter = new Figure(p1, p2, p3).PerimeterCalculator();
            double expectedPerimeter = 10.47;

            Assert.AreEqual(expectedPerimeter, actualPerimeter, 0.01);
        }
Beispiel #3
0
 static void displayInformation(Figure figure)
 {
     Console.WriteLine(String.Format("The figure is {0}. It`s perimeter is {1}", figure.GetName(), figure.PerimeterCalculator()));
 }