package test.leecode.array; import org.junit.Assert; import org.junit.Test; import cn.fansunion.leecode.array.max.MonotonicArray; /** * @author wen.lei@brgroup.com * * 2022-2-25 */ public class MonotonicArrayTest @Test public void test() MonotonicArray test = new MonotonicArray(); Assert.assertTrue(test.isMonotonic( new int [] 1 , 2 , 3 , 4 )); Assert.assertTrue(test.isMonotonic( new int [] 1 , 3 , 4 )); Assert.assertTrue(test.isMonotonic( new int [] 1 , 0 , 0 )); Assert.assertTrue(test.isMonotonic( new int [] 9 , 8 , 8 , 1 )); Assert.assertFalse(test.isMonotonic( new int [] 1 , 3 , 2 , 4 )); Assert.assertFalse(test.isMonotonic( new int [] 1 , 4 , 1 )); Assert.assertFalse(test.isMonotonic( new int [] 1 , 0 , 1 )); Assert.assertFalse(test.isMonotonic( new int [] 1 , 0 , - 1 ,- 2 ,- 1 ));
|