Esempio n. 1
0
        public void AddExistingSeasonTest()
        {
            Show s = new Show("Lost");

            Season s01 = new Season(1);

            Season s02 = new Season(1);

            s.Add(s01);
            s.Add(s02);
        }
Esempio n. 2
0
        public void AddSeasonTest()
        {
            Show s = new Show("Lost");

            Season s01 = new Season(1);
            s01.Add(new Episode(1, "Pilot"));
            s.Add(s01);

            s.Add(new Season(2));

            s.GetSeasonByNumber(2).Add(new Episode(1, "Second"));

            Assert.That(s.Count, Is.Not.EqualTo(0));
            Assert.That(s.Count, Is.EqualTo(2));
            Assert.That(s.GetSeasonByNumber(2).Number, Is.EqualTo(2));
        }
Esempio n. 3
0
        public void AddNullSeasonTest()
        {
            Show s = new Show("Lost");

            Season s01 = null;

            s.Add(s01);
        }
Esempio n. 4
0
        public void ContainsShowTest()
        {
            Show s = new Show("Lost");

            Season s01 = new Season(1);

            s01.Add(new Episode(1, "Pilot"));

            s.Add(s01);

            Assert.That(s.Contains(s01),Is.True);
        }
Esempio n. 5
0
        public void ClearCountTest()
        {
            Show s = new Show("Lost");

            Season s01 = new Season(1);

            s01.Add(new Episode(1, "Pilot"));

            s.Add(s01);

            Assert.That(s.Count, Is.EqualTo(1));

            s.Clear();

            Assert.That(s.Count, Is.EqualTo(0));
        }
Esempio n. 6
0
 static void Main(string[] args)
 {
     Show serie = new Show("Lost");
     Console.WriteLine("Show Objekt erzeugt\n");
     Season s01 = new Season(1);
     Console.WriteLine("Season Objekt erzeugt\n");
     s01.Add(new Episode(1,"Pilot"));
     s01.Add(new Episode(2, "The Tale of two towns"));
     Console.WriteLine("Folge hinzugefügt\n");
     serie.Add(s01);
     Console.WriteLine("Season zur Serie hinzugefuegt\n");
     Console.WriteLine("Serie: "+serie.Name+"\n");
     foreach (var season in serie)
     {
         Console.WriteLine("Season: " + season.Number+"\n");
         foreach (var folge in season)
         {
             Console.WriteLine("Folge: " + folge.Number + " Name: " + folge.Name);
         }
     }
 }
Esempio n. 7
0
        public void CopyToTest()
        {
            Show s = new Show("Lost");

            Season s01 = new Season(1);
            Season s02 = new Season(2);

            s01.Add(new Episode(1, "Pilot"));
            s01.Add(new Episode(2, "Second"));
            s01.Add(new Episode(3, "Third"));

            s.Add(s01);
            s.Add(s02);

            Season[] liste = new Season[s.Count];

            s.CopyTo(liste, 0);

            Assert.That(liste[0].Number, Is.EqualTo(1));
            Assert.That(liste[0].GetEpisodeByNumber(3).Name, Is.EqualTo("Third"));
            Assert.That(liste[1].Number, Is.EqualTo(2));
        }
Esempio n. 8
0
        public void RemoveSeasonTest()
        {
            Show s = new Show("Lost");

            Season s01 = new Season(1);
            s.Add(s01);

            s.Remove(s01);
            Assert.That(s.Count, Is.EqualTo(0));
        }
Esempio n. 9
0
        public void RemoveNotExistingSeasonTest()
        {
            Show s = new Show("Lost");
            s.Add(new Season(1));

            Season s02 = new Season(2);

            Assert.That(!s.Remove(s02));
        }
Esempio n. 10
0
        public void EqualsTrueTest()
        {
            Season s01 = new Season(1);
            s01.Add(new Episode(1, "Pilot"));
            s01.Add(new Episode(2, "Second"));

            Season s02 = new Season(2);
            s02.Add(new Episode(1, "Pilot"));
            s02.Add(new Episode(2, "Second"));

            Show show1 = new Show("Lost");
            show1.Add(s01);
            show1.Add(s02);

            Show show2 = new Show("Lost");
            show2.Add(s01);
            show2.Add(s02);

            Assert.That(show1.Equals(show2));
        }
Esempio n. 11
0
        public void EqualsFalseTest()
        {
            //TODO: Geht noch nicht
            Season s01 = new Season(1);
            s01.Add(new Episode(1, "Pilot"));
            s01.Add(new Episode(2, "Second"));

            Season s02 = new Season(2);
            s02.Add(new Episode(1, "Pilot"));
            s02.Add(new Episode(2, "BLa"));

            Show show1 = new Show("Lost");
            show1.Add(s01);
            show1.Add(s02);

            Show show2 = new Show("Lost");
            show2.Add(s01);
            show2.Add(s02);

            Assert.That(show1.Equals(show2),Is.False);
        }