示例#1
0
        public void WhenTheArrayIsAllTheSameHighestForLoopReturnsMax()
        {
            int[] nums   = { 10, 10, 10, 10 };
            var   result = Highest.HighestForLoop(nums);

            Assert.AreEqual(10, result);
        }
示例#2
0
        public void HighestForLoopTest()
        {
            int[] nums   = { 1, 3 };
            var   result = Highest.HighestForLoop(nums);

            Assert.AreEqual(-5, result);
        }
示例#3
0
        public void WhenTheArrayIsOnlyNegativeHighestForLoop()
        {
            int[] nums   = { -1, -50, -100, -20 };
            var   result = Highest.HighestForLoop(nums);

            Assert.AreEqual(-1, result);
        }
示例#4
0
        public void WhenTheArrayIsEmptyHighestForLoopReturnsMin()
        {
            int[] nums   = { };
            var   result = Highest.HighestForLoop(nums);

            Assert.AreEqual(int.MinValue, result);
        }
示例#5
0
        public void HighestForLoopTest()
        {
            int[] nums   = { -10, -6, -22, -17, -3 };
            var   result = Highest.HighestForLoop(nums);

            Assert.AreEqual(-3, result);
        }
        public void HighestForLoopTest(int[] nums, int expected)
        {
            var result = Highest.HighestForLoop(nums);

            Assert.AreEqual(expected, result);
        }
示例#7
0
 public void HighestForLoopTest()
 {
     int[] nums = {};
     Assert.Throws <Exception>(() => Highest.HighestForLoop(nums));
 }