Exemplo n.º 1
0
        public void Sort_UnsortedList_BecomeSorted()
        {
            var arraySorter = new GenericArraySorter <string>(new FakeSurnameComparator());

            string[] namesList = { "Phil Spencer", "Steve Jobs", "Aaron Jobs" };
            string[] result    = { "Aaron Jobs", "Phil Spencer", "Steve Jobs" };

            arraySorter.Sort(namesList);

            Assert.That(result, Is.EqualTo(namesList));
        }
Exemplo n.º 2
0
        public void Sort_NullList_ThrowsException()
        {
            var sorter = new GenericArraySorter <string>(new FakeSurnameComparator());

            Assert.That(() => sorter.Sort(null), Throws.Exception);
        }