Beispiel #1
0
        public void FindMaxFloatNumberat3rdPosition(double num1, double num2, double num3, double expected)
        {
            FindMaximumNum maxOffloat = new FindMaximumNum();

            double actual = maxOffloat.FindMaxFloat(num1, num2, num3);

            Assert.AreEqual(expected, actual);
        }
Beispiel #2
0
        public void FindMaxNumberat2ndPosition(int num1, int num2, int num3, int expected)
        {
            FindMaximumNum maxOfIntegers = new FindMaximumNum();

            int actual = maxOfIntegers.FindMaxInteger(num1, num2, num3);

            Assert.AreEqual(expected, actual);
        }
Beispiel #3
0
        public void FindMaxStringNumberat3rdPosition(string str1, string str2, string str3, string expected)
        {
            FindMaximumNum maxOfString = new FindMaximumNum();

            string actual = maxOfString.FindMaxString(str1, str2, str3);

            Assert.AreEqual(expected, actual);
        }
Beispiel #4
0
        public void FindMaxNumberat1stPosition(int num1, int num2, int num3, int expected) //get parametes
        {
            FindMaximumNum maxOfIntegers = new FindMaximumNum();                           //create object of the class

            int actual = maxOfIntegers.FindMaxInteger(num1, num2, num3);                   //call method

            Assert.AreEqual(expected, actual);                                             // compare
        }
Beispiel #5
0
        static void Main(string[] args)
        {
            Console.WriteLine("Testing the maximum of three numbers");
            int[] intArray             = { 1, 2, 3 };
            FindMaximumNum <int> find1 = new FindMaximumNum <int>(intArray);

            float[] floatArray           = { 11.1f, 12.2f, 13.3f };
            FindMaximumNum <float> find2 = new FindMaximumNum <float>(floatArray);

            string[] stringArray          = { "apple", "banana", "peach" };
            FindMaximumNum <string> find3 = new FindMaximumNum <string>(stringArray);

            find1.PrintMaxValue();
            find2.PrintMaxValue();
            find3.PrintMaxValue();
            //Console.WriteLine(find1.FindMaximumNum());
            //Console.WriteLine(find2.FindMaximumNum());
            //Console.WriteLine(find3.FindMaximumNum());
        }