public void WithinIndex() { // Type Array @this = new[] {"Fizz", "Buzz"}; // Exemples bool result1 = @this.WithinIndex(1); // return true; bool result2 = @this.WithinIndex(2); // return false; // Unit Test Assert.IsTrue(result1); Assert.IsFalse(result2); }
public void WithinIndexTestCase() { Array array = new[] { "0", "1", "2" }; var actual = array.WithinIndex( 2 ); Assert.IsTrue( actual ); actual = array.WithinIndex( -1 ); Assert.IsFalse( actual ); actual = array.WithinIndex( 5 ); Assert.IsFalse( actual ); }