本文整理汇总了C#中Season.GetEpisodeByNumber方法的典型用法代码示例。如果您正苦于以下问题:C# Season.GetEpisodeByNumber方法的具体用法?C# Season.GetEpisodeByNumber怎么用?C# Season.GetEpisodeByNumber使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Season
的用法示例。
在下文中一共展示了Season.GetEpisodeByNumber方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddGoodEpisodeTest
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"));
}
示例2: CreateSeasonTest
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"));
}
示例3: GetNonExistingEpisodeTest
public void GetNonExistingEpisodeTest()
{
Season s01 = new Season(1);
s01.Add(new Episode(1, "Pilot"));
//Get not existing Episode
Episode ep = s01.GetEpisodeByNumber(2);
}
示例4: GetEpisodeGoodTest
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"));
}