MSTest에서 반환 된 컬렉션의 순서가 올바른지 어떻게 알 수 있습니까?컬렉션의 순서가 올바른지 확인하십시오.
[TestMethod]
public void when_sorting_movies_it_should_be_able_to_sort_all_movies_by_title_descending()
{
populateTestMovies(movie_collection);
MovieLibrary movieLibrary = new MovieLibrary(movie_collection);
IEnumerable<Movie> results = movieLibrary.sort_all_movies_by_title_descending();
Assert.IsTrue(results.Contains(theres_something_about_mary));
Assert.IsTrue(results.Contains(the_ring));
Assert.IsTrue(results.Contains(shrek));
Assert.IsTrue(results.Contains(pirates_of_the_carribean));
Assert.IsTrue(results.Contains(indiana_jones_and_the_temple_of_doom));
Assert.IsTrue(results.Contains(cars));
Assert.IsTrue(results.Contains(a_bugs_life));
Assert.AreEqual(7, results.Count());
}
'/ (?! <=) = (? ==)/== /'. – delnan
IEnumerable에는 인덱서가 없습니다. –
alexn