当前位置: 首页>>代码示例>>C#>>正文


C# Season.GetEpisodeByNumber方法代码示例

本文整理汇总了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"));
        }
开发者ID:rubiktubik,项目名称:tvmanager,代码行数:15,代码来源:SeasonTest.cs

示例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"));
        }
开发者ID:rubiktubik,项目名称:tvmanager,代码行数:22,代码来源:SeasonTest.cs

示例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);
 }
开发者ID:rubiktubik,项目名称:tvmanager,代码行数:7,代码来源:SeasonTest.cs

示例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"));
        }
开发者ID:rubiktubik,项目名称:tvmanager,代码行数:15,代码来源:SeasonTest.cs


注:本文中的Season.GetEpisodeByNumber方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。