Пример #1
0
        public void TriangleAreaNegativeFail()
        {
            Shape triangleArea = ShapesAreaCalculator.GetShape(3);

            triangleArea.CalculateArea(2, -2);
            Assert.AreEqual(0.5 * 2 * -2, triangleArea.area, "Correct Area");
        }
Пример #2
0
        public void RectangleAreaChoiceFail()
        {
            Shape rectangleArea = ShapesAreaCalculator.GetShape(3);

            rectangleArea.CalculateArea(1, 2);
            Assert.AreNotEqual(1 * 2, rectangleArea.area, "Correct Area");
        }
Пример #3
0
        public void RectangleAreaParameterFail()
        {
            Shape rectangleArea = ShapesAreaCalculator.GetShape(2);

            rectangleArea.CalculateArea(1);
            Assert.AreNotEqual(1 * 1, rectangleArea.area, "Correct Area");
        }
Пример #4
0
        public void CircleAreaNegativeFail()
        {
            Shape circleArea = ShapesAreaCalculator.GetShape(1);

            circleArea.CalculateArea(-1);
            Assert.AreEqual(Math.PI * 1 * 1, circleArea.area, "Correct Area");
        }
Пример #5
0
        public void CircleAreaParameterFail()
        {
            Shape circleArea = ShapesAreaCalculator.GetShape(1);

            circleArea.CalculateArea(1, 2);
            Assert.AreEqual(Math.PI * 1 * 1, circleArea.area, "Correct Area");
        }
Пример #6
0
        public void NullArea()
        {
            Shape triangleArea = ShapesAreaCalculator.GetShape(3);

            triangleArea.CalculateArea(0, 0);
            Assert.AreEqual(0, triangleArea.area, "Correct Area");
        }
Пример #7
0
        public void CircleArea()
        {
            Shape  circleArea = ShapesAreaCalculator.GetShape(1);
            double radius     = 1;

            circleArea.CalculateArea(radius);
            Assert.AreEqual(Math.PI * radius * radius, circleArea.area, "Correct Area");
        }
Пример #8
0
 public void ChoiceFail()
 {
     Shape circleArea = ShapesAreaCalculator.GetShape('a');
 }