コード例 #1
0
ファイル: Program.cs プロジェクト: mcnuggz/NetflixProject
        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();
        }
コード例 #2
0
ファイル: GenreTests.cs プロジェクト: mcnuggz/NetflixProject
        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);
        }
コード例 #3
0
ファイル: GenreTests.cs プロジェクト: mcnuggz/NetflixProject
        public void AddToAnimationListTest()
        {
            Title nightmare = new Title("The Nightmare Before Christmas", 9);
            Genre.animatedList.Add(nightmare);

            Title expected = new Title("The Nightmare Before Christmas", 9);
            Title actual = Genre.animatedList[2];

            Assert.AreEqual(expected.Name, actual.Name);
            Assert.AreEqual(expected.Rating, actual.Rating);
        }
コード例 #4
0
ファイル: GenreTests.cs プロジェクト: mcnuggz/NetflixProject
        public void AddToComedyListTest()
        {
            Title montyPython = new Title("Monty Python and The Holy Grail", 9);
            Genre.comedyList.Add(montyPython);

            Title expected = new Title("Monty Python and The Holy Grail", 9);
            Title actual = Genre.comedyList[2];

            Assert.AreEqual(expected.Name, actual.Name);
            Assert.AreEqual(expected.Rating, actual.Rating);
        }
コード例 #5
0
ファイル: GenreTests.cs プロジェクト: mcnuggz/NetflixProject
        public void AddToRomanceListTest()
        {
            Title casablanca = new Title("Casablanca", 9);
            Genre.romanceList.Add(casablanca);

            Title expected = new Title("Casablanca", 9);
            Title actual = Genre.romanceList[2];

            Assert.AreEqual(expected.Name, actual.Name);
            Assert.AreEqual(expected.Rating, actual.Rating);
        }
コード例 #6
0
ファイル: GenreTests.cs プロジェクト: mcnuggz/NetflixProject
        public void AddToActionListTest()
        {

            Title madMax = new Title("Mad Max: Fury Road", 9);
            Genre.actionList.Add(madMax);

            Title expected = new Title("Mad Max: Fury Road", 9);
            Title actual = Genre.actionList[2];

            Assert.AreEqual(expected.Name, actual.Name);
            Assert.AreEqual(expected.Rating, actual.Rating);
        }
コード例 #7
0
ファイル: GenreTests.cs プロジェクト: mcnuggz/NetflixProject
        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
ファイル: Genre.cs プロジェクト: mcnuggz/NetflixProject
 public static void AddToActionList(Title title)
 {
     Console.WriteLine("Action: ");
     if (!actionList.Contains(title))
     {
         actionList.Add(title);
         foreach (Title t in actionList)
         {
             Console.WriteLine(t.Name + ": " + t.Rating.ToString() + "/10.");
         }
     }
     else
     {
         Console.WriteLine("Already exists in Action list");
     }
 }
コード例 #9
0
ファイル: GenreTests.cs プロジェクト: mcnuggz/NetflixProject
        public void AddToSciFiListTest()
        {
            Title terminator = new Title("The Terminator", 9);
            Genre.scifiList.Add(terminator);

            Title expected = new Title("The Terminator", 9);
            Title actual = Genre.scifiList[2];

            Assert.AreEqual(expected.Name, actual.Name);
            Assert.AreEqual(expected.Rating, actual.Rating);
        }
コード例 #10
0
ファイル: GenreTests.cs プロジェクト: mcnuggz/NetflixProject
        public void TestOverride()
        {
            Genre comedy = new Genre("Comedy");
            Title title2 = new Title("Chef", 9);
            Genre comedy2 = title2 + comedy;

            Assert.AreEqual(comedy, comedy2);
        }
コード例 #11
0
ファイル: GenreTests.cs プロジェクト: mcnuggz/NetflixProject
        public void AddToDramaListTest()
        {
            Title gravity = new Title("Gravity", 9);
            Genre.dramaList.Add(gravity);

            Title expected = new Title("Gravity", 9);
            Title actual = Genre.dramaList[2];

            Assert.AreEqual(expected.Name, actual.Name);
            Assert.AreEqual(expected.Rating, actual.Rating);
        }
コード例 #12
0
ファイル: Genre.cs プロジェクト: mcnuggz/NetflixProject
 public static void AddToRomanceList(Title title)
 {
     Console.WriteLine("Romance Movies:");
     if (!romanceList.Contains(title))
     {
         romanceList.Add(title);
         foreach (Title t in romanceList)
         {
             Console.WriteLine(t.Name + ": " + t.Rating.ToString() + "/10.");
         }
     }
     else
     {
         Console.WriteLine("Already exists in Romance list");
     }
 }
コード例 #13
0
ファイル: Genre.cs プロジェクト: mcnuggz/NetflixProject
 public void AddToList(Title title)
 {
     titleList.Add(title);
 }
コード例 #14
0
ファイル: Genre.cs プロジェクト: mcnuggz/NetflixProject
 public static void AddToDramaList(Title title)
 {
     Console.WriteLine("Drama Movies:");
     if (!dramaList.Contains(title))
     {
         dramaList.Add(title);
         foreach (Title t in dramaList)
         {
             Console.WriteLine(t.Name + ": " + t.Rating.ToString() + "/10.");
         }
     }
     else
     {
         Console.WriteLine("Already exists in Drama list");
     }
 }
コード例 #15
0
ファイル: Genre.cs プロジェクト: mcnuggz/NetflixProject
 public static void AddToSciFiList(Title title)
 {
     Console.WriteLine("Sci-Fi Movies:");
     if (!scifiList.Contains(title))
     {
         scifiList.Add(title);
         foreach (Title t in scifiList)
         {
             Console.WriteLine(t.Name + ": " + t.Rating.ToString() + "/10.");
         }
     }
     else
     {
         Console.WriteLine("Already exists in Sci-Fi list");
     }
 }
コード例 #16
0
ファイル: Genre.cs プロジェクト: mcnuggz/NetflixProject
 public static void AddToComedyList(Title title)
 {
     Console.WriteLine("Comedy Movies:");
     if (!comedyList.Contains(title))
     {
         comedyList.Add(title);
         foreach (Title t in comedyList)
         {
             Console.WriteLine(t.Name + ": " + t.Rating.ToString() + "/10.");
         }
     }
     else
     {
         Console.WriteLine("Already exists in Comedy list");
     }
 }