public void FilterByTitleTestDataFound() { //Create an instance of the filtered data clsFilmCollection FilteredFilms = new clsFilmCollection(); //Variable to store outcome Boolean OK = true; //Apply a Title that doesn exist FilteredFilms.FilterByTitle("Zzzzzzzz"); //Check that the correct number of records are found if (FilteredFilms.Count == 2) { //Check that the first record is ID 36 if (FilteredFilms.FilmList[0].FilmID != 36) { OK = false; } //Check that the first record is ID 37 if (FilteredFilms.FilmList[0].FilmID != 37) { OK = false; } } else { OK = false; } //Test to see that there are no records Assert.IsTrue(OK); }
public void FIlterByTitleNoneFound() { //Create an instance of the filtered data clsFilmCollection FilteredFilms = new clsFilmCollection(); //Apply a title that doesn't exist FilteredFilms.FilterByTitle("Zzzzzzzz!"); //Test to see that there are no records Assert.AreEqual(0, FilteredFilms.Count); }
public void FilterByTitleMethodOK() { //Create an instance of the class containing unfiltered results clsFilmCollection AllFilms = new clsFilmCollection(); //Create an instance of the filtered data clsFilmCollection FilteredFilms = new clsFilmCollection(); //Apply a blank string (should return all records) FilteredFilms.FilterByTitle(""); //Test to see that the two values are the same Assert.AreEqual(AllFilms.Count, FilteredFilms.Count); }