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


C# School.TryCreateCourse方法代码示例

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


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

示例1: CanNotCreateTwoEqualCourcesInSchool

        public void CanNotCreateTwoEqualCourcesInSchool()
        {
            School school = new School();

            school.TryCreateCourse(33);
            bool isSecondCourseCreated = school.TryCreateCourse(33);

            Assert.IsFalse(isSecondCourseCreated, "Second course with exist course id mast not be created");
        }
开发者ID:razsilev,项目名称:TelerikAcademy_Homework,代码行数:9,代码来源:SchoolTests.cs

示例2: CreateCorectCourceInSchool

        public void CreateCorectCourceInSchool()
        {
            School school = new School();

            bool isCourseCreated = school.TryCreateCourse(33);

            Assert.IsTrue(isCourseCreated, "Can not create course.");
        }
开发者ID:razsilev,项目名称:TelerikAcademy_Homework,代码行数:8,代码来源:SchoolTests.cs

示例3: JoinStudentInCourse

        public void JoinStudentInCourse()
        {
            School school = new School();
            Student pesho = new Student("Pesho", 10100);

            school.TryCreateCourse(33);

            bool isStudentAdded = school.TryJoinStudentInCourse(pesho, 33);

            Assert.IsTrue(isStudentAdded, "Can not add student in course.");
        }
开发者ID:razsilev,项目名称:TelerikAcademy_Homework,代码行数:11,代码来源:SchoolTests.cs

示例4: CanNotHaveTwoStudentsInOneSchoolWithEqualNumbers

        public void CanNotHaveTwoStudentsInOneSchoolWithEqualNumbers()
        {
            School school = new School();
            Student pesho = new Student("Pesho", 10100);
            Student gosho = new Student("Gosho", 10100);

            school.TryCreateCourse(33);
            school.TryJoinStudentInCourse(pesho, 33);
            bool isGoshoJoinInCourse = school.TryJoinStudentInCourse(gosho, 33);

            Assert.IsFalse(isGoshoJoinInCourse, "Can not have in one school students whit equal numbers.");
        }
开发者ID:razsilev,项目名称:TelerikAcademy_Homework,代码行数:12,代码来源:SchoolTests.cs

示例5: CanNotJoinMoreThenMaxStudentInCourse

        public void CanNotJoinMoreThenMaxStudentInCourse()
        {
            School school = new School();
            Student student = new Student("Pesho", 10100);

            school.TryCreateCourse(33);

            for (int i = 0; i < 30; i++)
            {
                var currentStudent = new Student("Pesho", 10005 + i);
                school.TryJoinStudentInCourse(currentStudent, 33);
            }

            bool isStudentAdded = school.TryJoinStudentInCourse(student, 33);

            Assert.IsFalse(isStudentAdded, "Can not add more then 30 students in course.");
        }
开发者ID:razsilev,项目名称:TelerikAcademy_Homework,代码行数:17,代码来源:SchoolTests.cs

示例6: JoinStudentToTwoDiferantCourses

        public void JoinStudentToTwoDiferantCourses()
        {
            School school = new School();
            Student pesho = new Student("Pesho", 10100);

            school.TryCreateCourse(33);
            school.TryCreateCourse(15);

            bool isStudentAddedToCourse33 = school.TryJoinStudentInCourse(pesho, 33);
            bool isStudentAddedToCourse15 = school.TryJoinStudentInCourse(pesho, 15);

            bool isStudentJoinetToTwoCourses = isStudentAddedToCourse33 && isStudentAddedToCourse15;

            Assert.IsTrue(isStudentJoinetToTwoCourses, "Student is not joined to two courses.");
        }
开发者ID:razsilev,项目名称:TelerikAcademy_Homework,代码行数:15,代码来源:SchoolTests.cs

示例7: StudentLeaveNotExistedCourse

        public void StudentLeaveNotExistedCourse()
        {
            School school = new School();
            Student pesho = new Student("Pesho", 10100);

            school.TryCreateCourse(33);
            school.TryJoinStudentInCourse(pesho, 33);

            var student = school.StudentLeaveCourse(10100, 3);

            Assert.IsNull(student, "Student can not be removed from not existed cource.");
        }
开发者ID:razsilev,项目名称:TelerikAcademy_Homework,代码行数:12,代码来源:SchoolTests.cs

示例8: StudentChangeCourse

        public void StudentChangeCourse()
        {
            School school = new School();
            Student pesho = new Student("Pesho", 10100);

            school.TryCreateCourse(33);
            school.TryCreateCourse(15);
            school.TryJoinStudentInCourse(pesho, 33);

            var student = school.StudentLeaveCourse(10100, 33);
            bool isStudentchangeCourse = school.TryJoinStudentInCourse(student, 15);

            Assert.IsTrue(isStudentchangeCourse, "Student can not change course.");
        }
开发者ID:razsilev,项目名称:TelerikAcademy_Homework,代码行数:14,代码来源:SchoolTests.cs

示例9: NotExistedInSchoolStudentLeaveExistedCourse

        public void NotExistedInSchoolStudentLeaveExistedCourse()
        {
            School school = new School();
            Student pesho = new Student("Pesho", 10100);

            school.TryCreateCourse(33);

            var student = school.StudentLeaveCourse(10100, 3);

            Assert.IsNull(student, "Student can not leave course when hi is not from this school");
        }
开发者ID:razsilev,项目名称:TelerikAcademy_Homework,代码行数:11,代码来源:SchoolTests.cs

示例10: MastNotJoinNullStudentInCourse

        public void MastNotJoinNullStudentInCourse()
        {
            School school = new School();
            Student student = null;

            school.TryCreateCourse(33);

            bool isStudentAdded = school.TryJoinStudentInCourse(student, 33);

            Assert.IsFalse(isStudentAdded, "Can not add null student in course.");
        }
开发者ID:razsilev,项目名称:TelerikAcademy_Homework,代码行数:11,代码来源:SchoolTests.cs

示例11: MastNotJoinExistedStudentInNotExistedCourse

        public void MastNotJoinExistedStudentInNotExistedCourse()
        {
            School school = new School();
            Student student = new Student("Pesho", 10100);

            school.TryCreateCourse(33);
            school.TryJoinStudentInCourse(student, 33);

            bool isStudentAddedToNotExistedCourse = school.TryJoinStudentInCourse(student, 5);

            Assert.IsFalse(isStudentAddedToNotExistedCourse, "Can not add student in course.");
        }
开发者ID:razsilev,项目名称:TelerikAcademy_Homework,代码行数:12,代码来源:SchoolTests.cs


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