public void PhotosAreSorted(int initialPhotoCount, string category) { string path = category == "exterior" ? ExteriorRepositoryPath : InteriorRepositoryPath; InitializeFolder(4, path); PhotoRepository repo = new PhotoRepository(path); List <string> photos = repo.GetFiles().ToList(); string[] fileNames = GetFileNames(path); bool isSorted = true; for (int index = 0; index < fileNames.Length; index++) { if (fileNames[index] == photos[index]) { continue; } isSorted = false; break; } Assert.IsTrue(isSorted, "Files Are Not Sorted Properly"); }