public void AreaTest() { Circle target = new Circle(0); target.Radius = double.Epsilon; Assert.AreEqual(Math.PI * double.Epsilon * double.Epsilon, target.Area); target.Radius = 0; Assert.AreEqual(0, target.Area); target.Radius = 1; Assert.AreEqual(Math.PI, target.Area); target.Radius = 2; Assert.AreEqual(4 * Math.PI, target.Area); target.Radius = double.MaxValue; Assert.AreEqual(double.PositiveInfinity, target.Area); target.Radius = double.NaN; Assert.IsTrue(double.IsNaN(target.Area)); }
public void ConstructorTest() { double radius = 0; Circle target = new Circle(radius); Assert.AreEqual(radius, target.Radius); }
public void ConstructorExceptionTest() { Circle target = new Circle(-1); }
public void RadiusTest() { double radius = 0; double expected = 10; double actual; Circle target = new Circle(radius); target.Radius = expected; actual = target.Radius; Assert.AreEqual(expected, actual); }
public void RadiusExceptionTest() { Circle target = new Circle(0); target.Radius = -1; }