public void Test_UpgradedSelectionSorter_ShouldThrowExceptionWhenCollectionIsNull() { var sorter = new UpgradedSelectionSorter <int>(); var emptyCollection = new SortableCollection <int>(null); emptyCollection.Sort(sorter); }
public void Test_UpgradedSelectionSorter_ShouldSortCorrectly() { var upgradedSelectionSorter = new UpgradedSelectionSorter <int>(); collection.Sort(upgradedSelectionSorter); bool isSortedCorrectly = true; for (int i = 0; i < collection.Items.Count - 1; i++) { if (collection.Items[i].CompareTo(collection.Items[i + 1]) > 0) { isSortedCorrectly = false; break; } } Assert.IsTrue(isSortedCorrectly, "UpgradedSelectionSorter should sort correctly."); }
public void Test_UpgradedSelectionSorter_ShouldThrowExceptionWhenCollectionIsNull() { var sorter = new UpgradedSelectionSorter<int>(); var emptyCollection = new SortableCollection<int>(null); emptyCollection.Sort(sorter); }
public void Test_UpgradedSelectionSorter_ShouldSortCorrectly() { var upgradedSelectionSorter = new UpgradedSelectionSorter<int>(); collection.Sort(upgradedSelectionSorter); bool isSortedCorrectly = true; for (int i = 0; i < collection.Items.Count - 1; i++) { if (collection.Items[i].CompareTo(collection.Items[i + 1]) > 0) { isSortedCorrectly = false; break; } } Assert.IsTrue(isSortedCorrectly, "UpgradedSelectionSorter should sort correctly."); }