コード例 #1
0
        public void CircleCalculator_GetArea_Exception_Test()
        {
            var radius = double.MaxValue;
            var circle = new Circle(Point2D.ZeroPoint, radius);

            var calculator = CalculatorFactory.ProduceCircleCalculator();

            Assert.ThrowsException <CalculateAreaException>(() => calculator.GetArea(circle));
        }
コード例 #2
0
        public void CircleCalculator_GetArea_Test()
        {
            var radius = 10.5d;
            var circle = new Circle(Point2D.ZeroPoint, radius);

            var calculator = CalculatorFactory.ProduceCircleCalculator();
            var circleArea = calculator.GetArea(circle);

            var s = Math.PI * radius * radius;

            Assert.AreEqual(s, circleArea, TestSettings.Delta);
        }