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


C# Student.SignCourse方法代码示例

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


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

示例1: StudentShouldBeAbbleToSignACourse

 public void StudentShouldBeAbbleToSignACourse()
 {
     var student = new Student("Goshko");
     var course = new Course("Goshko's course");
     student.SignCourse(course);
     Assert.IsTrue(student.Courses.Contains(course));
 }
开发者ID:DanteSparda,项目名称:TelerikAcademy,代码行数:7,代码来源:StudentTests.cs

示例2: StudentShouldBeAbleToCorrectlyRemoveCourse

 public void StudentShouldBeAbleToCorrectlyRemoveCourse()
 {
     var student = new Student("Goshko");
     var course = new Course("Goshko's course");
     student.SignCourse(course);
     student.UnsignCourse(course);
     Assert.IsFalse(student.Courses.Contains(course));
 }
开发者ID:DanteSparda,项目名称:TelerikAcademy,代码行数:8,代码来源:StudentTests.cs

示例3: StudentShouldSignCourseCorrectly

 public void StudentShouldSignCourseCorrectly()
 {
     var student = new Student("John", "Doe", 12345);
     var course = new Course("C#");
     student.SignCourse(course);
     Assert.IsTrue(student.Courses.Contains(course));
     Assert.IsTrue(course.Students.Contains(student));
 }
开发者ID:MarinaGeorgieva,项目名称:TelerikAcademy,代码行数:8,代码来源:StudentTests.cs

示例4: StudentShouldBeAbleToAddAlotOfCourses

 public void StudentShouldBeAbleToAddAlotOfCourses()
 {
     var student = new Student("Goshko");
     for (int i = 0; i < 250; i++)
     {
         var course = new Course("Name: " + i);
         student.SignCourse(course);
     }
 }
开发者ID:DanteSparda,项目名称:TelerikAcademy,代码行数:9,代码来源:StudentTests.cs

示例5: StudentShouldBeAbleToCorrectlyRemoveALotOfCourses

        public void StudentShouldBeAbleToCorrectlyRemoveALotOfCourses()
        {
            var student = new Student("Goshko");
            var listOFCourses = new List<Course>();
            for (int i = 0; i < 250; i++)
            {
                var course = new Course("Name: " + i);
                student.SignCourse(course);
                listOFCourses.Add(course);
            }

            foreach (var course in listOFCourses)
            {
                student.UnsignCourse(course);
            }

            Assert.IsTrue(student.Courses.Count == 0, "All courses should be removed");
        }
开发者ID:DanteSparda,项目名称:TelerikAcademy,代码行数:18,代码来源:StudentTests.cs

示例6: StudentShouldThrowIfTheCourseTriesToBeAddedMoreThanOnce

 public void StudentShouldThrowIfTheCourseTriesToBeAddedMoreThanOnce()
 {
     var student = new Student("Goshko");
     var course = new Course("Goshko's course");
     student.SignCourse(course);
     student.SignCourse(course);
 }
开发者ID:DanteSparda,项目名称:TelerikAcademy,代码行数:7,代码来源:StudentTests.cs

示例7: StudentShouldThrowIfCourseToAddIsNull

 public void StudentShouldThrowIfCourseToAddIsNull()
 {
     var student = new Student("Goshko");
     student.SignCourse(null);
 }
开发者ID:DanteSparda,项目名称:TelerikAcademy,代码行数:5,代码来源:StudentTests.cs

示例8: StudentShouldThrowWhenSigningNullCourse

 public void StudentShouldThrowWhenSigningNullCourse()
 {
     var student = new Student("John", "Doe", 12345);
     Course course = null;
     student.SignCourse(course);
 }
开发者ID:MarinaGeorgieva,项目名称:TelerikAcademy,代码行数:6,代码来源:StudentTests.cs


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