public void CalculateArea_SomeValues_MatchResult(double radius, double expected) { var circle = _factory.CreateCircle(radius); var area = _calc.GetArea(circle); area.Should().BeApproximately(expected, 1e-10); }
public void Should_ReturnSameAreaWithGivenPrecision_When_CircleGetAreaInvoked(double precision) { var radius = _fixture.Create <double>(); var circle = _figureFactoryfactory.CreateCircle(radius); var expected = radius * radius * Math.PI; var result = circle.GetArea(); var diff = expected - result; diff = diff * Math.Sign(diff); Assert.IsTrue(diff <= precision); }
public Figure(FigureFactory factory) { circle = factory.CreateCircle(); square = factory.CreateSquare(); }
public void Should_CreateCircleInstance_When_CircleFactoryCreateCircle() { var result = _figureFactoryfactory.CreateCircle(It.IsAny <double>()); Assert.IsInstanceOfType(result, typeof(Circle)); }