public void GivenAnEmptyArray_Reverse_ReturnsAnEmptyArray() { int[] array = { }; var result = CollectionsExercisesClass.Reverse(array); Assert.AreEqual(0, array.Length); }
public void NextInQueue_DoesNotThrowException_IfTheQueueIsTooShort() { var result = CollectionsExercisesClass.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 = CollectionsExercisesClass.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 = CollectionsExercisesClass.NextInQueue(num, _queue); Assert.AreEqual(expectedQueueCount, _queue.Count); }
public void GivenANumber_NextInQueue_ReturnsCorrectNames(int num, string expectedNames) { var result = CollectionsExercisesClass.NextInQueue(num, _queue); Assert.AreEqual(expectedNames, result); }
public void GivenAString_CountDigits_ReturnsACountOfEachDigit(string input, string expectedOutput) { var result = CollectionsExercisesClass.CountDigits(input); Assert.AreEqual(expectedOutput, result); }