static void Main(string[] args) { Genres all = new Genres("all"); Genres romance = new Genres("romance"); Genres action = new Genres("action"); Genres comody = new Genres("comody"); List<Title> myCatalogList = new List<Title>(); List<Genres> entertainmentGenre = new List<Genres>(); List<Genres> comodyShow = new List<Genres>(); List<Episode> That70sEpisodes = new List<Episode>(); // var entertainmentGenre = new Tuple<Genres>(action); entertainmentGenre.Add(action); Movie LOTR = new Movie("Lord of The Rings", entertainmentGenre, 283, 9); Episode piolet = new Episode("piolet", comodyShow, 7); That70sEpisodes.Add(piolet); TVShow That70sShow = new TVShow("That 70's Show", comodyShow,That70sEpisodes,8); myCatalogList.Add(LOTR); myCatalogList.Add(That70sShow); Catalog myCatalog = new Catalog(myCatalogList); myCatalog.AddEntertainmentToGenreList(myCatalogList); foreach(Genres genre in LOTR) { Console.WriteLine(genre.title); } //getList()); Console.WriteLine("The Show '{0}' your on episode '{1}' and it has a rating of '{2}'",That70sShow.title, That70sShow.TVEpisodeList[0].title,That70sShow.rating); Console.WriteLine("The Movie '{2}' is a '{0}' genre and is '{1}' minutes long and has a rating of '{3}'",LOTR.MovieGenreList[0].title, LOTR.MovieLength, LOTR.title, LOTR.rating); Console.ReadLine(); }
public void Test5() { TV_Show himym = new TV_Show("How I Met Your Mother"); Episode one = new Episode(5); Episode two = new Episode(3); himym.ListEpisodes.Add(one); himym.ListEpisodes.Add(two); Assert.AreEqual(two.rating, 3); }
static void Main(string[] args) { Movie scottP = new Movie("Scott Pilgrim vs the World", 119); Movie superman = new Movie("Superman", 110); Movie IT = new Movie("It", 98); Movie nemo = new Movie("Finding Nemo", 89); scottP.Name = "Scott Pilgrim vs the World"; IT.Name = "IT"; nemo.Name = "Finding Nemo"; superman.Name = "Superman"; scottP.rating = 5; superman.rating = 4; IT.rating = 3; nemo.rating = 4; Genre comedy = new Genre(); Genre scary = new Genre(); Genre funny = new Genre(); comedy.name = "comedy"; comedy.MyTitles.Add(scottP); comedy.MyTitles.Add(superman); scary.MyTitles.Add(IT); scary.MyTitles.Add(nemo); funny = (comedy+scary); Console.WriteLine(comedy.MyTitles[0]); Console.WriteLine(comedy.MyTitles[1]); Console.WriteLine("---"); Console.WriteLine(scary.MyTitles[0]); Console.WriteLine(scary.MyTitles[1]); Console.WriteLine("---"); Console.WriteLine(funny.MyTitles[0]); Console.WriteLine(funny.MyTitles[1]); Console.WriteLine(funny.MyTitles[2]); Console.WriteLine(funny.MyTitles[3]); Console.WriteLine("---"); View.printGenreTitle(comedy); TV_Show himym = new TV_Show("How I Met Your Mother"); Episode one = new Episode(5); Episode two = new Episode(3); himym.ListEpisodes.Add(one); himym.ListEpisodes.Add(two); Console.WriteLine("Name of TV Show {0}", himym); Console.WriteLine("Rating {0} ", himym.ListEpisodes[0].rating); Console.WriteLine("Rating {0} ", himym.ListEpisodes[1].rating); Console.WriteLine("Average Rating "+himym.rating); Console.ReadKey(); }