예제 #1
0
        public void CalculateArea_Correct(double radius, double area)
        {
            var circle = FlatFigureFabric.CreateCircle(radius);
            var result = circle.CalculateArea();

            Assert.AreEqual(area, result);
        }
예제 #2
0
        public void NewFigure_3Param_Triangle()
        {
            var figure = FlatFigureFabric.CreateFigure(5, 4, 8);

            Assert.IsInstanceOf <Triangle>(figure);
        }
예제 #3
0
 public void NewFigure_Null_Exception()
 {
     Assert.Throws <ArgumentNullException>(() => FlatFigureFabric.CreateFigure(null));
 }
예제 #4
0
        public void NewFigure_1Param_Circle()
        {
            var figure = FlatFigureFabric.CreateFigure(5);

            Assert.IsInstanceOf <Circle>(figure);
        }
예제 #5
0
 public void NewTriangle_NotATriangle_Exception(double a, double b, double c)
 {
     Assert.Throws <InvalidFigureValidationException>(() => FlatFigureFabric.CreateTriangle(a, b, c));
 }
예제 #6
0
 public void NewTriangle_PositiveSides_OK(double a, double b, double c)
 {
     Assert.DoesNotThrow(() => FlatFigureFabric.CreateTriangle(a, b, c));
 }
예제 #7
0
 public void NewCircle_NotPositiveRadius_Exception(double radius)
 {
     Assert.Throws <ValidationException>(() => FlatFigureFabric.CreateCircle(radius));
 }
예제 #8
0
 public void NewCircle_PositiveRadius_OK(double radius)
 {
     Assert.DoesNotThrow(() => FlatFigureFabric.CreateCircle(radius));
 }
예제 #9
0
        public void NewFigure_WrongParam_Exception(int size)
        {
            var arr = new double[size];

            Assert.Throws <ArgumentException>(() => FlatFigureFabric.CreateFigure(arr));
        }