public void SortExtension_ShouldThrowIfInputListIsNull() { var baseSorter = new MockChildOfBaseSorter <int>(); List <int> nullList = null; Assert.Throws <ArgumentNullException>("list", () => baseSorter.Sort(nullList, (x, y) => x - y)); }
public void Sort_ShouldThrowIfInputListIsNull() { var baseSorter = new MockChildOfBaseSorter <int>(); List <int> nullList = null; Assert.Throws <ArgumentNullException>("list", () => baseSorter.Sort(nullList, Comparer <int> .Default)); }
public void SortExtension_ShouldThrowIfInputComparisonIsNull() { var baseSorter = new MockChildOfBaseSorter <int>(); var list = new List <int>(); Comparison <int> comparison = null; Assert.Throws <ArgumentNullException>("comparison", () => baseSorter.Sort(list, comparison)); }
public void Sort_ShouldThrowIfInputComparerIsNull() { var baseSorter = new MockChildOfBaseSorter <int>(); var list = new List <int>(); IComparer <int> comparer = null; Assert.Throws <ArgumentNullException>("comparer", () => baseSorter.Sort(list, comparer)); }
public void Sort_ShouldNotModifyTheListIfZeroElement() { var baseSorter = new MockChildOfBaseSorter <int>(); var list = new List <int>(); baseSorter.Sort(list, Comparer <int> .Default); Assert.Empty(list); }
public void Sort_ShouldNotModifyTheListIfOneElement() { var baseSorter = new MockChildOfBaseSorter <int>(); int theOnlyOneValue = 2; var list = new List <int> { theOnlyOneValue }; baseSorter.Sort(list, Comparer <int> .Default); Assert.Single(list); Assert.Equal(theOnlyOneValue, list[0]); }