本文整理汇总了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");
}
示例2: CreateCorectCourceInSchool
public void CreateCorectCourceInSchool()
{
School school = new School();
bool isCourseCreated = school.TryCreateCourse(33);
Assert.IsTrue(isCourseCreated, "Can not create course.");
}
示例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.");
}
示例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.");
}
示例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.");
}
示例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.");
}
示例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.");
}
示例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.");
}
示例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");
}
示例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.");
}
示例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.");
}