Пример #1
0
        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);
        }
Пример #2
0
        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);
        }
Пример #3
0
 public void ConstructorExceptionTest()
 {
     Ellipse target = new Ellipse(-1, -1);
 }
Пример #4
0
        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);
        }
Пример #5
0
 public void RadiusAExceptionTest()
 {
     Ellipse target = new Ellipse(0, 0);
     target.RadiusA = -1;
 }