public void SortTheOdd_HasOddAndEven(int[] input) { var expected = new[] { 1, 3, 2, 8, 5, 4 }.ToExpectedObject(); var actual = SortTheOdd.SortArray(input); expected.ShouldEqual(actual); }
public void SortTheOdd_HasOnlyEvenNum(int[] input) { var expected = new[] { 2, 6, 4, 8 }.ToExpectedObject(); var actual = SortTheOdd.SortArray(input); expected.ShouldEqual(actual); }
public void SortTheOdd_EmptyArray(int[] input) { var expected = new int[0].ToExpectedObject(); var actual = SortTheOdd.SortArray(input); expected.ShouldEqual(actual); }
public void Sort_ValidInput_SortedOddsReturned() { // Arrange var input = new int[] { 5, 3, 2, 8, 1, 4 }; var output = new int[] { 1, 3, 2, 8, 5, 4 }; // Act var result = SortTheOdd.Sort(input); // Assert result.Should().BeEquivalentTo(output); }
public void GivenEmptyArrayThenEmptyArrayReturned() { Assert.Equal(new int[] { }, SortTheOdd.SortArray(new int[] { })); }
public void GivenArrayWithOddsAndEvensThenOddsSortedArrayReturned() { Assert.Equal(new int[] { 3, 20, 7, 9, 8, 15 }, SortTheOdd.SortArray(new int[] { 7, 20, 3, 15, 8, 9 })); }
public void GivenOnlyOddsArrayThenSortedArrayReturned() { Assert.Equal(new int[] { 3, 7, 9, 15 }, SortTheOdd.SortArray(new int[] { 7, 3, 15, 9 })); }
public void GivenOnlyEvensArrayThenSameArrayReturned() { Assert.Equal(new int[] { 2, 8, 6, 10 }, SortTheOdd.SortArray(new int[] { 2, 8, 6, 10 })); }
public void BasicTests() { Assert.AreEqual(new int[] { 1, 3, 2, 8, 5, 4 }, SortTheOdd.SortArray(new int[] { 5, 3, 2, 8, 1, 4 })); Assert.AreEqual(new int[] { 1, 3, 5, 8, 0 }, SortTheOdd.SortArray(new int[] { 5, 3, 1, 8, 0 })); Assert.AreEqual(new int[] { }, SortTheOdd.SortArray(new int[] { })); }
public void Test_Sort1() { Assert.Equal(new int[] { 1, 3, 2, 8, 5, 4 }, SortTheOdd.Sort(new int[] { 5, 3, 2, 8, 1, 4 })); Assert.Equal(new int[] { 1, 3, 5, 8, 0 }, SortTheOdd.Sort(new int[] { 5, 3, 1, 8, 0 })); Assert.Equal(new int[] { }, SortTheOdd.Sort(new int[] { })); }