public void SortStrategy_ConstructorISortTypeIStepCounter_StepCounterIsNull_ThrowArgumentNullException() { ISortType sortType = new StubISortType() { UpdateIEnumerableOfDecimal = (notUpdatedSequence) => notUpdatedSequence }; Assert.ThrowsException <ArgumentNullException>(() => GetSortStrategy(sortType, null)); }
public void SortStrategy_Sort_SequenceIsNull_ThrowArgumentNullException() { ISortType sortType = new StubISortType() { UpdateIEnumerableOfDecimal = (notUpdatedSequence) => notUpdatedSequence }; IStepCounter stepCounter = new StubIStepCounter() { CountSwapOperation = () => { }, CountCompareOperation = () => { } }; var sortStrategy = GetSortStrategy(sortType, stepCounter); Assert.ThrowsException <ArgumentNullException>(() => sortStrategy.Sort(null)); }
public void SortStrategy_Sort_SequenceIsEmpty_ReturnEmptySequence() { ISortType sortType = new StubISortType() { UpdateIEnumerableOfDecimal = (notUpdatedSequence) => notUpdatedSequence }; IStepCounter stepCounter = new StubIStepCounter() { CountSwapOperation = () => { }, CountCompareOperation = () => { } }; var sortStrategy = GetSortStrategy(sortType, stepCounter); var expectedSequence = new decimal[1]; ISortResult sortResult = sortStrategy.Sort((new decimal[1])); CollectionAssert.AreEqual(expectedSequence, sortResult.SortedNumbers.ToArray()); }