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


C# Season.Add方法代码示例

本文整理汇总了C#中Season.Add方法的典型用法代码示例。如果您正苦于以下问题:C# Season.Add方法的具体用法?C# Season.Add怎么用?C# Season.Add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Season的用法示例。


在下文中一共展示了Season.Add方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CopyToTest

        public void CopyToTest()
        {
            Season s01 = new Season(1);

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

            Episode[] liste = new Episode[s01.Count];

            s01.CopyTo(liste, 0);

            Assert.That(liste[0].Name, Is.EqualTo("Pilot"));
            Assert.That(liste[1].Name, Is.EqualTo("Second"));
            Assert.That(liste[2].Name, Is.EqualTo("Third"));
        }
开发者ID:rubiktubik,项目名称:tvmanager,代码行数:16,代码来源:SeasonTest.cs

示例2: ClearCountTest

        public void ClearCountTest()
        {
            Season s01 = new Season(1);

            s01.Add(new Episode(1, "Pilot"));
            Assert.That(s01.Count, Is.EqualTo(1));
            s01.Clear();
            Assert.That(s01.Count, Is.EqualTo(0));
        }
开发者ID:rubiktubik,项目名称:tvmanager,代码行数:9,代码来源:SeasonTest.cs

示例3: ContainsTest

        public void ContainsTest()
        {
            Season s01 = new Season(1);

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

            Episode ep1 = new Episode(1,"Pilot");

            Assert.That(s01.Contains(ep1));
        }
开发者ID:rubiktubik,项目名称:tvmanager,代码行数:10,代码来源:SeasonTest.cs

示例4: ContainsShowTest

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

示例5: Main

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

示例6: AddDoubleEpisodeTest

        public void AddDoubleEpisodeTest()
        {
            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(2, "Dritte Folge"));
        }
开发者ID:rubiktubik,项目名称:tvmanager,代码行数:13,代码来源:SeasonTest.cs

示例7: 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

示例8: AddSeasonTest

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

示例9: Main

        static void Main(string[] args)
        {
            Mediateka mediateka = new Mediateka();

            mediateka.Add(new Clip() {
                Name = "Ace of base",
                Duration = new TimeSpan(0, 2, 30),
                Rating = Rating.Average,
                CreationDate = new DateTime(2010, 10, 3) }
                );
            mediateka.Add(new Photo() {
                Name = "Mountain",
                Rating = Rating.Low,
                CreationDate = new DateTime(2005, 5, 5) }
                );
            #region add serial
            SerialBuilder serialBuilder = new SerialBuilder()
            {
                Name = "Game of Thrones",
                CreationDate = new DateTime(2009, 4, 4),
                Rating = Rating.High,
            };

            Season season = new Season() { Name = "dsdsd", CreationDate = new DateTime(2009, 6, 6), Rating = Rating.High };
            season.Add(new Movie() { Name = "Origin", Duration = new TimeSpan(0, 40, 0), Rating = Rating.High, CreationDate = new DateTime(2009, 6, 6) });

            serialBuilder.Seasons.Add(season);
            mediateka.Add(serialBuilder.Construct());
            #endregion

            mediateka.SortByCreationDate();

            foreach (var i in mediateka)
            {
                Console.WriteLine("{0}, {1}", i.Name, i.CreationDate);
            }

            //object obj = new object();
            //obj = new object();
            //object obj1 = new object();

            //string sss = "System.Object";
            //Console.WriteLine("{0} {1}", obj.GetHashCode(), obj1.GetHashCode());

            //Dictionary<Movie, string> dic = new Dictionary<Movie, string>();
        }
开发者ID:Kesha85,项目名称:EPAM_Spring_Training_2015,代码行数:46,代码来源:Program.cs

示例10: 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

示例11: 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

示例12: EqualsTrueTest

        public void EqualsTrueTest()
        {
            Season s01 = new Season(1);
            s01.Add(new Episode(1, "Pilot"));
            s01.Add(new Episode(2, "Second"));

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

            Assert.That(s01.Equals(s02));
        }
开发者ID:rubiktubik,项目名称:tvmanager,代码行数:12,代码来源:SeasonTest.cs

示例13: CopyToTest

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

示例14: EqualsTrueTest

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

示例15: EqualsFalseTest

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


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