示例#1
0
 public Data()
 {
     string path = @"Movies.xml";
     XmlLoader movies = new XmlLoader(path);
     titles = movies.LoadMovies();
     genre = new Genre(titles);
     List<TvShow> tvshows = new List<TvShow>
     {
         new TvShow(GenreList.Horror, "American Horror Story", 7.4,
             new List<Episode>
             {
                 new Episode(101, 8.4),
                 new Episode(102, 8.0),
                 new Episode(103, 7.4),
                 new Episode(104, 8.5),
                 new Episode(105, 9.0),
                 new Episode(106, 7.0),
                 new Episode(107, 9.3),
                 new Episode(108, 8.2),
                 new Episode(109, 8.1),
                 new Episode(110, 9.5),
                 new Episode(111, 9.7),
                 new Episode(112, 7.2),
                 new Episode(113, 7.5)
             })
     };
     foreach (TvShow show in tvshows)
     {
         genre += show;
     }
  
 }
示例#2
0
文件: View.cs 项目: jmattefs/netflix
        public void Sort()
        {
           
            Genre g = new Genre();
            string input = Initial();
            switch (input)
            {
                case "A":
                case "a":
                    LinkMovie();
                    break;
                case "B":
                case "b":
                    LinkTV();
                    break;
                case "C":
                case "c":
                    LinkAll();
                    break;
                default:
                    Sort();
                    break;

            }
        }
示例#3
0
 public static Genre operator +(Genre newGenre, Title title)
 {
     Genre newGenreTitle = new Genre();
     newGenreTitle.title.AddRange(newGenreTitle.title);
     newGenreTitle.title.Add(title);
     return newGenreTitle;
 }
示例#4
0
        static void Main(string[] args)
        {
            View view = new View();
            
            Genre action = new Genre("Action");
            Genre animation = new Genre("Animation");
            Genre comedy = new Genre("Comedy");
            Genre drama = new Genre("Drama");
            Genre romance = new Genre("Romance");
            Genre scifi = new Genre("Sci-Fi");

            Title title1 = new Title("Toy Story", 9);
            Title ToyStory = title1;

            Title title2 = new Title("Sunset Boulevard", 9);
            Title sunsetBlvd = title2;


            drama = title2 + drama;
            animation = title1 + animation;

            Genre.AddToAnimationList(title1);
            Console.WriteLine("");
            Genre.AddToDramaList(title2);
            Console.ReadLine();
        }
示例#5
0
 public static Genre operator +(Genre genre1, Genre genre2)
 {
     Genre newGenre = new Genre();
     newGenre.title.AddRange(genre1.title);
     newGenre.title.AddRange(genre2.title);
     return newGenre;
 }
示例#6
0
        public void AddToListTest()
        {
            Genre g = new Genre("g");
            g.AddToList("Teen Titans", 9);
            Title expected = new Title("Teen Titans", 9);
            Title actual = Genre.titleList[0];

            Assert.AreEqual(expected.Name, actual.Name);
            Assert.AreEqual(expected.Rating, actual.Rating);
        }
示例#7
0
        public void AddToListTestNoParams()
        {
            Genre g = new Genre("g");
            Title batman = new Title("Batman Beyond", 8);
            g.AddToList(batman);

            Title expected = new Title("Batman Beyond", 8);
            Title actual = Genre.titleList[1];

            Assert.AreEqual(expected.Name, actual.Name);
            Assert.AreEqual(expected.Rating, actual.Rating);

        }
示例#8
0
文件: View.cs 项目: jmattefs/netflix
        public string DisplayMovies()
        {
            string response = StartMovies();
            Genre genre = new Genre();
            switch (response)
            {
                case "A":
                case "a":
                    Console.WriteLine("---Type in a title to see more information---");
                    genre.GenreAction();
                    
                    string input = Console.ReadLine();
                    return input;
                case "B":
                case "b":
                    Console.WriteLine("---Type in a title to see more information---");

                    genre.GenreComedy();
                    string input2 = Console.ReadLine();
                    return input2;
                case "C":
                case "c":
                    Console.WriteLine("---Type in a title to see more information---");

                    genre.GenreRomance();
                    string input3 = Console.ReadLine();
                    return input3;
                    
                case "D":
                case "d":
                    Console.WriteLine("---Type in a title to see more information---");

                    genre.GenreAll();
                    string input4 = Console.ReadLine();
                    return input4;
                default:
                    return DisplayMovies();
                    
                   
            }

        }
示例#9
0
 static void Main(string[] args)
 {
     Genre g = new Genre();
     
 }
示例#10
0
        static void Main(string[] args)
        {
            Genre comedy = new Genre();
            Genre romance = new Genre();
            TvShow tvShow = new TvShow();
            Episode episode = new Episode();
            
            List<string> Comedy = new List<string>();
            Comedy.Add("Anchorman");
            Comedy.Add("The Animal");

            List<string> Romance = new List<string>();
            Romance.Add("Trainwreck");
            Romance.Add("Titanic");

            
            Movie Anchorman = new Movie();
            Anchorman.name = "Anchorman";
            Anchorman.rating = 4;
            Anchorman.duration = 94;

            Movie TheAnimal = new Movie();
            TheAnimal.name = "The Animal";
            TheAnimal.rating = 2;
            TheAnimal.duration = 83;

            Movie Trainwreck = new Movie();
            Trainwreck.name = "Trainwreck";
            Trainwreck.rating = 3;
            Trainwreck.duration = 125;

            Movie Titanic = new Movie();
            Titanic.name = "Titanic";
            Titanic.rating = 5;
            Titanic.duration = 194;


            tvShow.name = "Walking Dead Season 1";
            tvShow.numberOfEpisodes = 6;
            List<string> Episodes = new List<string>();
            Episodes.Add("Days Gone By");
            Episodes.Add("Guts");
            Episodes.Add("Tell it to the frogs");
            Episodes.Add("Vatos");
            Episodes.Add("Wildfire");
            Episodes.Add("TS -19");
            Episode DaysGoneBy = new Episode();
            DaysGoneBy.rating = 5;
            
            Episode Guts = new Episode();
            Guts.rating = 5;
            Episode TellItToTheFrogs = new Episode();
            TellItToTheFrogs.rating = 4;
            Episode Vatos = new Episode();
            Vatos.rating = null;
            Episode Wildfire = new Episode();
            Wildfire.rating = 3;
            Episode TS19 = new Episode();
            TS19.rating = 4;
            






            

            


        }
示例#11
0
文件: View.cs 项目: jmattefs/netflix
        public string DisplayAll()
        {
            Genre g = new Genre();
            Console.WriteLine("---Type in a title to see more information---");

            g.GenreAll();
            string title;
            title = Console.ReadLine();
            return title;
        }
示例#12
0
        public void TestOverride()
        {
            Genre comedy = new Genre("Comedy");
            Title title2 = new Title("Chef", 9);
            Genre comedy2 = title2 + comedy;

            Assert.AreEqual(comedy, comedy2);
        }
示例#13
0
文件: Genre.cs 项目: jmattefs/netflix
 public static Genre operator + (Genre genre, Title title)
 {
     Genre aggregate = new Genre();
     aggregate = genre + title;
     return aggregate;
 }
示例#14
0
文件: Genre.cs 项目: jmattefs/netflix
 public static Genre operator + (Genre Comedy, Genre Romantic)
 {
     Genre RomanticComedy = new Genre();
     RomanticComedy = Comedy + Romantic;
     return RomanticComedy;
 }