Example #1
0
 public void EmptyArrayTest1()
 {
     Assert.IsTrue(FirstNonConsecutive.Solution(new int[] { 1 }) == null);
 }
Example #2
0
 public void TestWithNegatives()
 {
     Assert.AreEqual(-4, FirstNonConsecutive.Solution(new int[] { -3, -2, -4, 0, 1, 4, 6, 7, 8 }));
 }
Example #3
0
 public void NullTest()
 {
     //If the whole array is consecutive then return null2.
     Assert.AreSame(null, FirstNonConsecutive.Solution(new int[] { 1, 2, 3, 4, 5, 6, 7, 8 }));
 }
Example #4
0
 public void SampleTest()
 {
     Assert.AreEqual(6, FirstNonConsecutive.Solution(new int[] { 1, 2, 3, 4, 6, 7, 8 }));
 }