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


C# School.AddCourse方法代码示例

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


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

示例1: AddingCourseThatAlreadyExistsShouldThrow

 public void AddingCourseThatAlreadyExistsShouldThrow()
 {
     School school = new School("Hogwards");
     Course course = new Course("BatCourse");
     school.AddCourse(course);
     school.AddCourse(course);
 }
开发者ID:Rostech,项目名称:TelerikAcademyHomeworks,代码行数:7,代码来源:SchoolTests.cs

示例2: AddTheSameCourse_AddTheSameCourseInShool_ShouldThrowNullException

 public void AddTheSameCourse_AddTheSameCourseInShool_ShouldThrowNullException()
 {
     var school = new School("HR.Smirnenski");
     var course = new Course();
     school.AddCourse(course);
     school.AddCourse(course);
 }
开发者ID:deskuuu,项目名称:TelerikAcademy,代码行数:7,代码来源:ShoolTests.cs

示例3: Main

        private static void Main()
        {
            try
            {
                Student pesho = new Student("Pesho Georgiev");
                Student gosho = new Student("Gosho Ivanov");
                Student misho = new Student("Misho Cekov");
                Student sasho = new Student("Sasho Kostov");

                Course telerikAcademy = new Course("Telerik Academy");
                Course webProgramming = new Course("Web Programming");

                webProgramming.AddStudent(sasho);

                telerikAcademy.AddStudent(pesho);
                telerikAcademy.AddStudent(gosho);
                telerikAcademy.AddStudent(misho);

                telerikAcademy.RemoveStudent(gosho);
                Console.WriteLine(gosho.ToString() + " was removed from course.");

                Console.WriteLine("Courses:");
                Console.WriteLine(telerikAcademy);

                School freeSchool = new School("School of Computer Sciences");
                freeSchool.AddCourse(webProgramming);
                freeSchool.AddCourse(telerikAcademy);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
开发者ID:niki-funky,项目名称:Telerik_Academy,代码行数:33,代码来源:Demo.cs

示例4: SchoolShouldThrowWhenAddedCourseAlreadyExists

        public void SchoolShouldThrowWhenAddedCourseAlreadyExists()
        {
            School telerikAcademy = new School("TelerikAcademy");
            Course highQualityCode = new Course("High quality code");

            telerikAcademy.AddCourse(highQualityCode);
            telerikAcademy.AddCourse(highQualityCode);
        }
开发者ID:atanas-georgiev,项目名称:TelerikAcademy-1,代码行数:8,代码来源:SchoolTests.cs

示例5: NewCourseToAddShouldThrownAnExceptionIfAlreadyExists

        public void NewCourseToAddShouldThrownAnExceptionIfAlreadyExists()
        {
            var school = new School("Telerik");
            var course = new Course("Math");

            school.AddCourse(course);
            school.AddCourse(course);
        }
开发者ID:DimitarGaydardzhiev,项目名称:TelerikAcademy,代码行数:8,代码来源:SchoolTests.cs

示例6: AddingCourseWithExistingNameShouldThrow

 public void AddingCourseWithExistingNameShouldThrow()
 {
     var school = new School("Greendale");
     var courseOne = new Course("Diving");
     school.AddCourse(courseOne);
     var courseTwo = new Course("Diving");
     school.AddCourse(courseTwo);
 }
开发者ID:mpenchev86,项目名称:Telerik-Academy,代码行数:8,代码来源:SchoolTests.cs

示例7: EnsureCourseCanBeAddedToSchollMoreThanOnce

        public void EnsureCourseCanBeAddedToSchollMoreThanOnce()
        {
            int number = 1;
            string name = "C#";
            Course course = new Course(name, number);

            School school = new School();
            school.AddCourse(course);
            school.AddCourse(course);
        }
开发者ID:ValMomchilova,项目名称:TelerikAcademyHomeWorks,代码行数:10,代码来源:UnitTestSchool.cs

示例8: TestAddCourse

		public void TestAddCourse()
		{
			Course php = new Course("PHP");
			Course js = new Course("Java Script");
			School mySchool = new School();

			mySchool.AddCourse(php);
			mySchool.AddCourse(js);
			Assert.AreEqual(mySchool.Courses.Count, 2);
			Assert.AreEqual(mySchool.Courses[1].Name, "Java Script");
		}
开发者ID:damy90,项目名称:Telerik-all,代码行数:11,代码来源:SchoolTests.cs

示例9: AddingCourseShouldCorrectlyAddCourseToTheSchool

 public void AddingCourseShouldCorrectlyAddCourseToTheSchool()
 {
     var school = new School();
     var course = new Course("What the hell!");
     school.AddCourse(course);
     Assert.AreEqual(1, school.Courses.Count, "School courses is not added properly!");
 }
开发者ID:NK-Hertz,项目名称:Telerik-Academy-2015,代码行数:7,代码来源:StudentAndCoursesTests.cs

示例10: SchoolShouldAddCourseCorrectly

 public void SchoolShouldAddCourseCorrectly()
 {
     var school = new School("Yane Sandanski");
     var course = new Course("Music");
     school.AddCourse(course);
     Assert.AreSame(course, school.Courses.First());
 }
开发者ID:ivanvasilev,项目名称:Telerik-Academy-Homeworks,代码行数:7,代码来源:SchoolTest.cs

示例11: Test_SchoolShouldAddCourseCorrectly

        public void Test_SchoolShouldAddCourseCorrectly()
        {
            var school = new School("Telerik");
            var course = new Course("Java Script");

            school.AddCourse(course);
        }
开发者ID:alexizvely,项目名称:Telerik-Academy-2015,代码行数:7,代码来源:SchoolTests.cs

示例12: SchoolShouldNotThrowAnExceptionWhenAddingValidCourse

        public void SchoolShouldNotThrowAnExceptionWhenAddingValidCourse()
        {
            var school = new School("School");
            var course = new Course("CSharp");

            school.AddCourse(course);
        }
开发者ID:AYankova,项目名称:HQC,代码行数:7,代码来源:SchoolTests.cs

示例13: AddingNewCourseShouldWorkCorrectly

 public void AddingNewCourseShouldWorkCorrectly()
 {
     var school = new School("Greendale");
     var course = new Course("Grifting");
     school.AddCourse(course);
     Assert.AreSame(course, school.Courses.First());
 }
开发者ID:mpenchev86,项目名称:Telerik-Academy,代码行数:7,代码来源:SchoolTests.cs

示例14: AddingNewCourseShoudProperlyWork

        public void AddingNewCourseShoudProperlyWork()
        {
            var school = new School();
            school.AddCourse(new Course());

            Assert.AreEqual(1, school.Courses.Count);
        }
开发者ID:TeeeeeC,项目名称:TelerikAcademy2015-2016,代码行数:7,代码来源:SchoolTest.cs

示例15: RemoveNullCourse_RemoveNullCourseFromShool_ShouldThrowArgumentNullException

 public void RemoveNullCourse_RemoveNullCourseFromShool_ShouldThrowArgumentNullException()
 {
     var school = new School("HR.Smirnenski");
     Course course = null;
     school.AddCourse(course);
     school.RemoveCourse(course);
 }
开发者ID:deskuuu,项目名称:TelerikAcademy,代码行数:7,代码来源:ShoolTests.cs


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