Пример #1
0
        public void Init()
        {
            NamesList = new List <string>();
            actual    = new List <string>();
            expected  = new List <string>();

            NameSort = new NameSorting();
        }//Init
Пример #2
0
        public void GetSortedNamesTests_2()
        {
            INameSorting  nameSorting = new NameSorting();
            List <string> testNames   = new List <string>();

            var result = nameSorting.WriteSortedNames(testNames);

            Assert.IsNotNull(result);
            Assert.AreEqual(result.Count, 0);
        }
Пример #3
0
        public void GetSortedNamesTests_3()
        {
            INameSorting  nameSorting = new NameSorting();
            List <string> testNames   = null;

            try
            {
                var result = nameSorting.WriteSortedNames(testNames);
                Assert.Fail("no exception thrown");
            }
            catch (Exception ex)
            {
                Assert.IsTrue(ex is Exception);
            }
        }
Пример #4
0
        public void GetSortedNamesTests_1()
        {
            INameSorting  nameSorting = new NameSorting();
            List <string> testNames   = new List <string>();

            testNames.Add("Vinod Singhal");
            testNames.Add("Vinod Kumar Singhal");
            testNames.Add("Vinod James Kumar Singhal");
            testNames.Add("Vinod Kumar");
            testNames.Add("Vinod Jameson");
            testNames.Add("Vinod Kumar Jameson");
            testNames.Add("Vinod James Kumar");
            testNames.Add("Vinod Henkels Vinod");
            testNames.Add("Vinod Vinod Vinod");

            var result = nameSorting.WriteSortedNames(testNames);

            Assert.IsNotNull(result);
            Assert.AreEqual(result.Count, testNames.Count);
        }