public void LongSequencePositiveReverseTest() { List <int> A = Enumerable.Range(1, 100000).ToList(); A.Reverse(); Assert.AreEqual(1, PermCheck.Solution(A.ToArray())); }
public void LongSequenceNegativeTest() { List <int> A = Enumerable.Range(1, 100000).ToList(); A.Remove(85635); Assert.AreEqual(0, PermCheck.Solution(A.ToArray())); }
public void ArrayOutOfRangeTest() { bool catchException = false; try { PermCheck.Solution(new int[100001]); } catch (ArgumentOutOfRangeException) { catchException = true; } if (catchException) { Assert.Pass(); } else { Assert.Fail(); } }
public void ArrayIsNulTest() { bool catchException = false; try { PermCheck.Solution(null); } catch (ArgumentNullException) { catchException = true; } if (catchException) { Assert.Pass(); } else { Assert.Fail(); } }
static void Main(string[] args) { PermCheck.Solution(Enumerable.Range(1, 10).ToArray()); }
public void ExampleNegativeTest() { Assert.AreEqual(0, PermCheck.Solution(new [] { 4, 1, 3 })); }
public void ExamplePositiveTest() { Assert.AreEqual(1, PermCheck.Solution(new [] { 4, 1, 3, 2 })); }
public void BigNumbersTest() { Assert.AreEqual(1, PermCheck.Solution(Enumerable.Range(999999000, 100).ToArray())); }
public void RepeatSmallNumberTest() { Assert.AreEqual(0, PermCheck.Solution(Enumerable.Repeat(1, 10).ToArray())); }
public void RepeatBigNumberTest() { Assert.AreEqual(0, PermCheck.Solution(Enumerable.Repeat(50, 25).ToArray())); }
public void TwoElementPositiveTest() { Assert.AreEqual(1, PermCheck.Solution(new[] { 5, 6 })); }
public void TwoElementNegativeTest() { Assert.AreEqual(0, PermCheck.Solution(new[] { 5, 8 })); }
public void OneElementTest() { Assert.AreEqual(1, PermCheck.Solution(new[] { 1 })); }