public void CalculateArea_Correct(double radius, double area) { var circle = FlatFigureFabric.CreateCircle(radius); var result = circle.CalculateArea(); Assert.AreEqual(area, result); }
public void NewFigure_3Param_Triangle() { var figure = FlatFigureFabric.CreateFigure(5, 4, 8); Assert.IsInstanceOf <Triangle>(figure); }
public void NewFigure_Null_Exception() { Assert.Throws <ArgumentNullException>(() => FlatFigureFabric.CreateFigure(null)); }
public void NewFigure_1Param_Circle() { var figure = FlatFigureFabric.CreateFigure(5); Assert.IsInstanceOf <Circle>(figure); }
public void NewTriangle_NotATriangle_Exception(double a, double b, double c) { Assert.Throws <InvalidFigureValidationException>(() => FlatFigureFabric.CreateTriangle(a, b, c)); }
public void NewTriangle_PositiveSides_OK(double a, double b, double c) { Assert.DoesNotThrow(() => FlatFigureFabric.CreateTriangle(a, b, c)); }
public void NewCircle_NotPositiveRadius_Exception(double radius) { Assert.Throws <ValidationException>(() => FlatFigureFabric.CreateCircle(radius)); }
public void NewCircle_PositiveRadius_OK(double radius) { Assert.DoesNotThrow(() => FlatFigureFabric.CreateCircle(radius)); }
public void NewFigure_WrongParam_Exception(int size) { var arr = new double[size]; Assert.Throws <ArgumentException>(() => FlatFigureFabric.CreateFigure(arr)); }