Beispiel #1
0
        public void NotCircleTest()
        {
            // Arrange
            var notCircle  = new TestFigure();
            var calculator = new CircleAreaCalculator();

            // Act
            var calculatedArea = calculator.TryCalculateArea(notCircle);

            // Assert
            Assert.Null(calculatedArea);
        }
Beispiel #2
0
        public void CircleCalculatorTest(double radius, double area)
        {
            // Arrange
            var circle     = new Circle(radius);
            var calculator = new CircleAreaCalculator();

            // Act
            var calculatedArea = calculator.TryCalculateArea(circle);

            // Assert
            Assert.AreEqual(area, calculatedArea, DoubleEquality.Epsilon);
        }