Example #1
0
        public void GiventStringArray_SortReturnMaxValue()
        {
            string[] arr = { "Apple", "Peach", "Banana" };
            GenericMaximum <string> max = new GenericMaximum <string>(arr);
            string result = max.MaxMethod();

            Assert.AreEqual("Peach", result);
        }
Example #2
0
        public void GiventIntegerArray_SortReturnMaxValue()
        {
            int[] arr = { 23, 35, 87, 233, 3, 44, 98 };
            GenericMaximum <int> max = new GenericMaximum <int>(arr);
            int result = max.MaxMethod();

            Assert.AreEqual(233, result);
        }
Example #3
0
        public void GiventFloatArray_SortReturnMaxValue()
        {
            float[] arr = { 23.3f, 45.5f, 87.4f, 23.3f, 4.3f, 44.4f, 9.8f };
            GenericMaximum <float> max = new GenericMaximum <float>(arr);
            float result = max.MaxMethod();

            Assert.AreEqual(87.4f, result);
        }
Example #4
0
        public void GivenFloatNumThirdPostion_whenFindMax_shouldReturnsMaxThirdPosition()
        {
            double[] arr = { 40.5, 20.5, 55.5 };
            GenericMaximum <double> floatMaxValue = new GenericMaximum <double>(arr);
            double actualMax = floatMaxValue.MaxMethod();

            Assert.AreEqual(55.5, actualMax);
        }
Example #5
0
        public void GivenMaxStringFirstPositon_whenFindMax_shouldReturnsMaxFirstPosition()
        {
            string[] arr = { "Peach", "Banana", "Apple" };
            GenericMaximum <string> stringMaxValue = new GenericMaximum <string>(arr);
            string actualMax = stringMaxValue.MaxMethod();

            Assert.AreEqual("Peach", actualMax);
        }
Example #6
0
        public void GivenMaxNumThirdPosition_whenFindMaxNum_shouldReturnsMaxThird()
        {
            int[] arr = { 225, 375, 467 };
            GenericMaximum <int> intMaxValue = new GenericMaximum <int>(arr);
            int actualMax = intMaxValue.MaxMethod();

            Assert.AreEqual(467, actualMax);
        }
Example #7
0
        public void GivenMoreThreeValue1_whenFindMax_shouldReturnsMaxValue()
        {
            int[] arr = { 112, 344, 432, 555, 678 };
            GenericMaximum <int> intMaxValue = new GenericMaximum <int>(arr);
            int actualMax = intMaxValue.MaxMethod();

            Assert.AreEqual(678, actualMax);
        }
Example #8
0
        public void GivenMoreThreeValue_whenFindMax_shouldReturnsMaxValue()
        {
            int[] arr = { 67, 23, 99, 44 };
            GenericMaximum <int> intMaxValue = new GenericMaximum <int>(arr);
            int actualMax = intMaxValue.MaxMethod();

            Assert.AreEqual(99, actualMax);
        }
Example #9
0
        public void GivenMaxNumFirstPosition_whenFindMaxNum_shouldReturnsMaxFirst()
        {
            int[] arr = { 225, 100, 24 };
            GenericMaximum <int> intMaxValue = new GenericMaximum <int>(arr);
            int actualMax = intMaxValue.MaxMethod();

            Assert.AreEqual(225, actualMax);
        }
Example #10
0
        public void Given_FloatArray_Check_With_Generic_Return_MaxValue()
        {
            GenericMaximum <float> generic = new GenericMaximum <float>(new float[3] {
                10.5f, 16.4f, 88.9f
            });
            float expected = 88.9f;
            float actual   = generic.MaxMethod();

            Assert.AreEqual(expected, actual);
        }
Example #11
0
        public void Given_IntegerArray_Check_With_Generic_Return_MaxValue()
        {
            int expected = 99;
            GenericMaximum <int> generic = new GenericMaximum <int>(new int[5] {
                24, 45, 65, 86, 99
            });
            int actual = generic.MaxMethod();

            Assert.AreEqual(expected, actual);
        }
Example #12
0
        public void Given_StringArray_Check_With_Generic_Return_MaxValue()
        {
            string expected = "Peach";
            GenericMaximum <string> generic = new GenericMaximum <string>(new string[4] {
                "Apple", "Banana", "Guava", "Peach"
            });
            string actual = generic.MaxMethod();

            Assert.AreEqual(expected, actual);
        }
        public void UC3Refactor2()
        {
            //Arrange
            double expected = 95.67;
            GenericMaximum <double> maxFloat = new GenericMaximum <double>(25.34, 95.67, 58.64);
            //Act
            double actual = maxFloat.MaxMethod();

            //Assert
            Assert.AreEqual(expected, actual);
        }