Exemple #1
0
        public void Passing_float_Array_Should_Return_Maximum_Valuee()
        {
            /*string firstValue = "Banana", secondValue = "Carrot", thirdValue = "Apple";
             * string expected = "Carrot";
             * FindMax find = new FindMax();
             * string actual = find.MaximumStringNumber(firstValue, secondValue, thirdValue);
             * Assert.AreEqual(expected, actual);*/
            float[]         floatArray = { 10.5f, 20.5f, 30.5f };
            float           expected   = 30.5f;
            FindMax <float> secod      = new FindMax <float>(floatArray);
            float           actual     = secod.FindMaxValue();

            Assert.AreEqual(expected, actual);
        }
Exemple #2
0
        public void Passing_string_Array_Should_Return_Maximum_Value()
        {
/*            string firstValue = "Apple", secondValue = "Banana", thirdValue = "Carrot";
 *          string expected = "Carrot";
 *          FindMax find = new FindMax();
 *          string actual = find.MaximumStringNumber(firstValue, secondValue, thirdValue);
 *          Assert.AreEqual(expected, actual);*/
            string[]         strArray = { "10", "20", "30" };
            string           expected = "30";
            FindMax <string> third    = new FindMax <string>(strArray);
            string           actual   = third.FindMaxValue();

            Assert.AreEqual(expected, actual);
        }
Exemple #3
0
        public void Passing_Integer_Array_Should_Return_Maximum_Value()
        {
            /*string firstValue = "Carrot", secondValue = "Banana", thirdValue = "Apple";
             * string expected = "Carrot";
             * FindMax find = new FindMax();
             * string actual = find.MaximumStringNumber(firstValue, secondValue, thirdValue);
             * Assert.AreEqual(expected, actual);*/
            int[]         intArray = { 10, 20, 30 };
            int           expected = 30;
            FindMax <int> first    = new FindMax <int>(intArray);
            int           actual   = first.FindMaxValue();

            Assert.AreEqual(expected, actual);
        }
Exemple #4
0
        static void Main(string[] args)
        {
            /*Console.WriteLine("===Welcome to my Max Number problem console app===");
             * FindMax find = new FindMax();
             * Console.WriteLine(find.MaximumIntegerNumber(10, 20, 30));
             * Console.WriteLine("=================================");
             * Console.WriteLine(find.MaximumFloatNumber(10.5f, 20.5f, 30.5f));
             * Console.WriteLine("=================================");
             * Console.WriteLine(find.MaximumStringNumber("Apple", "Banana", "Carrot"));*/
            int[]         intArray = { 112, 344, 432, 555, 678 };
            FindMax <int> first    = new FindMax <int>(intArray);

            float[]         floatArray = { 11.2f, 34.4f, 4.32f, 55.5f, 6.78f };
            FindMax <float> second     = new FindMax <float>(floatArray);

            string[]         stringArray = { "111", "222", "333", "55", "999" };
            FindMax <string> third       = new FindMax <string>(stringArray);

            first.PrintMaxValue();
            Console.WriteLine("=================================");
            second.PrintMaxValue();
            Console.WriteLine("=================================");
            third.PrintMaxValue();
        }