Beispiel #1
0
        public void MaxSubArray()
        {
            //Arrange
            int[] nums     = new int[] { -2, 1, -3, 4, -1, 2, 1, -5, 4 };
            int   expected = 6;

            //Act
            Solution053 s      = new Solution053();
            int         actual = s.MaxSubArray(nums);

            //Assert
            Assert.Equal(expected, actual);
        }
Beispiel #2
0
        public void MaxSubArray5()
        {
            //Arrange
            int[] nums     = new int[] { -1, 0, -2 };
            int   expected = 0;

            //Act
            Solution053 s      = new Solution053();
            int         actual = s.MaxSubArray(nums);

            //Assert
            Assert.Equal(expected, actual);
        }
Beispiel #3
0
 public void TestMethod(int[] nums, int output)
 {
     Assert.Equal(output, Solution053.MaxSubArray(nums));
 }