public void Test1() { FileReader fileReader = new FileReader(); NameSorter nameSorter = new NameSorter(); //original text file path string unsortedFile = "..\\..\\..\\Files\\unsorted-names-list.txt"; //after sorted text file path string sortedFile = "..\\..\\..\\Files\\sorted-names-list.txt"; List <string> list = fileReader.ReadFileAsStringList(unsortedFile); List <string> unsortedList = nameSorter.ReverseName(list).Select(o => o.Trim()).ToList(); List <string> sortedList = fileReader.ReadFileAsStringList(sortedFile).Select(o => o.Trim()).ToList(); Assert.AreEqual(unsortedList, sortedList); }