public void AddGoodEpisodeTest() { Episode ep1 = new Episode(1, "Pilot"); Episode ep2 = new Episode(2, "ZweiteFolge"); Dictionary<int, Episode> episoden = new Dictionary<int, Episode>(); episoden.Add(ep1.Number,ep1); episoden.Add(ep2.Number,ep2); Season se = new Season(1, episoden); se.Add(new Episode(3,"Dritte Folge")); Assert.That(se.GetEpisodeByNumber(3).Number, Is.EqualTo(3)); Assert.That(se.GetEpisodeByNumber(3).Name, Is.EqualTo("Dritte Folge")); }
public void CreateSeasonTest() { //Zwei Folgen erstellt Episode ep1 = new Episode(1, "Pilot"); Episode ep2 = new Episode(2, "ZweiteFolge"); //Liste von Folgen Dictionary<int, Episode> episoden = new Dictionary<int, Episode>(); //Folgen zur Liste hinzugefügt episoden.Add(ep1.Number, ep1); episoden.Add(ep2.Number, ep2); //Neue Season mit der Folgenliste erstellen Season se = new Season(1, episoden); Assert.That(se.Number, Is.EqualTo(1)); Assert.That(se.GetEpisodeByNumber(1).Number, Is.EqualTo(1)); Assert.That(se.GetEpisodeByNumber(2).Number, Is.EqualTo(2)); Assert.That(se.GetEpisodeByNumber(1).Name, Is.EqualTo("Pilot")); Assert.That(se.GetEpisodeByNumber(2).Name, Is.EqualTo("ZweiteFolge")); }
public void GetNonExistingEpisodeTest() { Season s01 = new Season(1); s01.Add(new Episode(1, "Pilot")); //Get not existing Episode Episode ep = s01.GetEpisodeByNumber(2); }
public void GetEpisodeGoodTest() { Season s01 = new Season(1); s01.Add(new Episode(1, "Pilot")); s01.Add(new Episode(2, "Second")); Episode first = s01.GetEpisodeByNumber(1); Episode second = s01.GetEpisodeByNumber(2); Assert.That(first.Number, Is.EqualTo(1)); Assert.That(first.Name, Is.EqualTo("Pilot")); Assert.That(second.Number, Is.EqualTo(2)); Assert.That(second.Name, Is.EqualTo("Second")); }