public void GivenAnEmptyArray_Reverse_ReturnsAnEmptyArray() { int[] array = { }; var result = CollectionsExercise.Reverse(array); Assert.AreEqual(0, array.Length); }
public void NextInQueue_DoesNotThrowException_IfTheQueueIsTooShort() { var result = CollectionsExercise.NextInQueue(7, _queue); Assert.AreEqual(0, _queue.Count); Assert.AreEqual("Cathy, Jim, Petra, Moxie, Petunia", result); }
public void GivenAnArray_Reverse_ReturnsTheArrayInReverse() { int[] array = { 10, 20, 30, 40, 50 }; var result = CollectionsExercise.Reverse(array); Assert.AreEqual(5, array.Length); for (int i = 0; i < 5; i++) { Assert.AreEqual(array[4 - i], result[i]); } }
public void GivenANumber_NextInQueue_RemoveExpectedNumberFromTheQueue(int num, int expectedQueueCount) { var result = CollectionsExercise.NextInQueue(num, _queue); Assert.AreEqual(expectedQueueCount, _queue.Count); }
public void GivenANumber_NextInQueue_ReturnsCorrectNames(int num, string expectedNames) { var result = CollectionsExercise.NextInQueue(num, _queue); Assert.AreEqual(expectedNames, result); }
public void GivenAString_CountDigits_ReturnsACountOfEachDigit(string input, string expectedOutput) { var result = CollectionsExercise.CountDigits(input); Assert.AreEqual(expectedOutput, result); }