mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2025-12-21 23:00:43 -08:00
Add test showing that reverse handles numbers less than zero.
This commit is contained in:
@@ -87,6 +87,19 @@ namespace Reverse.Tests
|
|||||||
Assert.True(sut.GetArray().SequenceEqual(output));
|
Assert.True(sut.GetArray().SequenceEqual(output));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void Reverse_WithIndexLessThanZero_DoesNothing()
|
||||||
|
{
|
||||||
|
var input = new int[] { 1, 2 };
|
||||||
|
var output = new int[] { 1, 2 };
|
||||||
|
var sut = new TestReverser(1);
|
||||||
|
sut.SetArray(input);
|
||||||
|
|
||||||
|
sut.Reverse(-1);
|
||||||
|
|
||||||
|
Assert.True(sut.GetArray().SequenceEqual(output));
|
||||||
|
}
|
||||||
|
|
||||||
[Theory]
|
[Theory]
|
||||||
[InlineData(new int[] { 1 })]
|
[InlineData(new int[] { 1 })]
|
||||||
[InlineData(new int[] { 1, 2 })]
|
[InlineData(new int[] { 1, 2 })]
|
||||||
|
|||||||
Reference in New Issue
Block a user