示例#1
0
        public void CalculateSquare_ReturnCircleSquare(string name = "", params double[] args)
        {
            double radius = args[0];
            double S      = Math.PI * Math.Pow(radius, 2);

            S = Math.Round(S, 12);

            double result = Lib.CalculateSquare(name, args);

            result = Math.Round(result, 12);

            Assert.AreEqual(result, S);
        }
示例#2
0
        public void CalculateSquare_ReturnTriangleSquare(string name = "", params double[] args)
        {
            double a = args[0];
            double b = args[1];
            double c = args[2];

            double p = (a + b + c) / 2;
            double S = Math.Sqrt(p * (p - a) * (p - b) * (p - c));

            S = Math.Round(S, 12);

            double result = Lib.CalculateSquare(name, args);

            result = Math.Round(result, 12);

            Assert.AreEqual(result, S);
        }