public void AddVideosToLibrary() { // setup Library Videos = new Library(TypeOfVideo.TVShow); Videos.Add(name, genre, description, year); // asserts Assert.AreEqual(Videos.Length(), 1, "Library size did not increment"); Assert.IsTrue(Videos.Exists(name), "Video does not exist after adding"); Assert.IsFalse(Videos.Exists("doesn't exist"), "Video exists even though it shouldn't"); }
public MainWindow() { InitializeComponent(); // Create our libraries Movies = new Library(TypeOfVideo.Movie); TVShows = new Library(TypeOfVideo.TVShow); // Setup the ComboBox MovieTVShowComboBox.Items.Add(TypeOfVideo.Movie); MovieTVShowComboBox.Items.Add(TypeOfVideo.TVShow); MovieTVShowComboBox.SelectedIndex = 0; // TV Shows PersonalFavorites[0] = new Video[] { new Video("Planet Earth", "Documentary", "A voyage around the world with many remarkable sights", 2006, TypeOfVideo.TVShow), new Video("Game of Thrones", "Fantasy", "Seven noble families fight for control of the mythical land of Westeros.", 2011, TypeOfVideo.TVShow) }; // Movies PersonalFavorites[1] = new Video[] { new Video("Django Unchained", "Adventure", "A freed slave sets out to rescue his wife from a brutal Mississippi plantation owner.", 2012, TypeOfVideo.Movie) }; // Prepopulate with favorites for (int i = 0; i < PersonalFavorites[0].Count(); i++) TVShows.Add(ref PersonalFavorites[0][i]); for (int i = 0; i < PersonalFavorites[1].Count(); i++) Movies.Add(ref PersonalFavorites[1][i]); UpdateListBox(); }
public void GetVideoByNameFromLibrary() { //setup Library Videos = new Library(TypeOfVideo.TVShow); Videos.Add(name, genre, description, year); // asserts Assert.AreEqual((Videos.GetByName(name)).Title, name, "Video found does not match in name"); Assert.IsTrue(Videos.GetByName("doesn't exist").Title == null, "GetByName found something that it shouldn't have"); }
public void RemoveVideosFromLibrary() { //setup Library Videos = new Library(TypeOfVideo.TVShow); Videos.Add(name, genre, description, year); // asserts Assert.AreEqual(Videos.Remove(name), 1, "Number of videos removed does not match expected."); Assert.AreEqual(Videos.Length(), 0, "Size of library did not decrease after removal"); }