public void AreaTest() { Ellipse target = new Ellipse(0, 0); Assert.AreEqual(0, target.Area); target.RadiusA = 5; target.RadiusB = 10; double expected = Math.PI * target.RadiusA * target.RadiusB; double actual = target.Area; double epsilon = 0.1; Assert.IsTrue(Math.Abs(actual - expected) < epsilon); }
public void ConstructorTest() { double radiusA = 0; double radiusB = 0; Ellipse target = new Ellipse(radiusA, radiusB); Assert.AreEqual(radiusA, target.RadiusA); Assert.AreEqual(radiusB, target.RadiusB); }
public void ConstructorExceptionTest() { Ellipse target = new Ellipse(-1, -1); }
public void RadiusATest() { double radiusA = 0; double expected = 10; double actual; Ellipse target = new Ellipse(radiusA, 0); target.RadiusA = expected; actual = target.RadiusA; Assert.AreEqual(expected, actual); }
public void RadiusAExceptionTest() { Ellipse target = new Ellipse(0, 0); target.RadiusA = -1; }