예제 #1
0
        public void IsCircleSizeEqual()
        {
            var radius        = 10;
            var ExpectedASize = Math.PI * Math.Pow(radius, 2);
            var circle        = new CircleShape(radius);
            var aSize         = AreaCalculator.GetAreaSize(circle);

            Assert.AreEqual(ExpectedASize, aSize);
        }
예제 #2
0
        public void IsTriangleSizeEqual()
        {
            double a = 14, b = 15, c = 12;
            var    triangle      = new TriangleShape(a, b, c);
            var    p             = 1 / 2 * (a + b + c);
            var    ExpectedASize = Math.Sqrt(p * (p - a) * (p - b) * (p - c));

            var aSize = AreaCalculator.GetAreaSize(triangle);

            Assert.AreEqual(ExpectedASize, aSize);
        }