示例#1
0
        public void Non_decreasingArrayTest(int[] givenArr, bool expectedResult)
        {
            //Action
            var actualResult = Non_decreasingArray.CheckPossibility(givenArr);

            //Assert
            Assert.AreEqual(expectedResult, actualResult);
        }
示例#2
0
        public void CheckPossibilityTests()
        {
            Non_decreasingArray obj = new Non_decreasingArray();

            var arr = new int[] { 4, 2, 3 };
            var x   = obj.CheckPossibility(arr);//t

            arr = new int[] { 4, 2, 1 };
            x   = obj.CheckPossibility(arr);//f

            arr = new int[] { 3, 4, 2, 3 };
            x   = obj.CheckPossibility(arr);//f

            arr = new int[] { 3 };
            x   = obj.CheckPossibility(arr);//t


            arr = new int[] { 2, 3, 3, 2, 4 };
            x   = obj.CheckPossibility(arr);//t
        }