本文整理汇总了C#中School.AddStudent方法的典型用法代码示例。如果您正苦于以下问题:C# School.AddStudent方法的具体用法?C# School.AddStudent怎么用?C# School.AddStudent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类School
的用法示例。
在下文中一共展示了School.AddStudent方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SchoolShouldThrowExceptionWhenAddingExistingStudent
public void SchoolShouldThrowExceptionWhenAddingExistingStudent()
{
var school = new School("Telerik Academy");
var student = new Student("Nikolay Kostov", 10000);
school.AddStudent(student);
school.AddStudent(student);
}
示例2: Test_SchoolShouldThrowExceptionWhenAddingExistingStudent
public void Test_SchoolShouldThrowExceptionWhenAddingExistingStudent()
{
var school = new School("Telerik Academy");
var student = new Student("Georgi", 10000);
school.AddStudent(student);
school.AddStudent(student);
}
示例3: AddingExistingStudentShouldThrow
public void AddingExistingStudentShouldThrow()
{
var school = new School("Greendale");
var studentOne = new Student("Peshkata", 10000);
school.AddStudent(studentOne);
school.AddStudent(studentOne);
}
示例4: AddingStudentWithSameUNTwiceShouldNotAddHimTwice
public void AddingStudentWithSameUNTwiceShouldNotAddHimTwice()
{
var school = new School();
school.AddStudent(new Student("Ivaylo", 10000));
school.AddStudent(new Student("Ivaylo", 10000));
Assert.AreEqual(1, school.Students.Count, "Student with same UN is added and should not!");
}
示例5: AddTheSameStudent_AddTheSameStudentInShool_ShouldThrowNullException
public void AddTheSameStudent_AddTheSameStudentInShool_ShouldThrowNullException()
{
var school = new School("HR.Smirnenski");
Student student = new Student("Anna MAriq", 9);
school.AddStudent(student);
school.AddStudent(student);
}
示例6: SchoolShouldThrowExceptionWhenAddingExistingStudent
public void SchoolShouldThrowExceptionWhenAddingExistingStudent()
{
var school = new School("Telerik Academy");
var student = new Student("John", "Doe", 12345);
school.AddStudent(student);
school.AddStudent(student);
}
示例7: TestAddDuplicateStudentId
public void TestAddDuplicateStudentId()
{
School school = new School();
school.AddStudent(new Student("Pesho", 50000));
school.AddStudent(new Student("Pesho", 50000));
}
示例8: SchoolShouldThrowExceptionWhenAddingExistingStudent
public void SchoolShouldThrowExceptionWhenAddingExistingStudent()
{
var school = new School("Telerik Academy");
var student = new Student("Jane Dow", 99999);
school.AddStudent(student);
school.AddStudent(student);
}
示例9: SchoolShouldThrowExceptionWhenAddingStudentWithDuplicateId
public void SchoolShouldThrowExceptionWhenAddingStudentWithDuplicateId()
{
var school = new School("Yane Sandanski");
var student = new Student("Jimmy Hendrix", 10000);
var otherStudent = new Student("Neil Pert", 10000);
school.AddStudent(student);
school.AddStudent(otherStudent);
}
示例10: TestResgistringStudentsWithSameNumberToSchoolToThrow
public void TestResgistringStudentsWithSameNumberToSchoolToThrow()
{
var testSchool = new School("Telerik Academy");
var pesho = new Student("Pesho", 10000);
var gosho = new Student("Gosho", 10000);
testSchool.AddStudent(pesho);
testSchool.AddStudent(gosho);
}
示例11: SchoolShouldThrowExceptionWhenAddingStudentWithDuplicateId
public void SchoolShouldThrowExceptionWhenAddingStudentWithDuplicateId()
{
var school = new School("Telerik Academy");
var student = new Student("John", "Doe", 12345);
var otherStudent = new Student("Peter", "Johnson", 12345);
school.AddStudent(student);
school.AddStudent(otherStudent);
}
示例12: AddingExistingStudentShouldThrow
public void AddingExistingStudentShouldThrow()
{
School school = new School("Hogwards");
Student student = new Student("Stamat", 10000);
school.AddStudent(student);
school.AddStudent(student);
}
示例13: SchoolShouldThrowWhenAddedStudentAlreadyExists
public void SchoolShouldThrowWhenAddedStudentAlreadyExists()
{
School telerikAcademy = new School("TelerikAcademy");
Student gosho = new Student(10000, "Georgi", "Petrov");
telerikAcademy.AddStudent(gosho);
telerikAcademy.AddStudent(gosho);
}
示例14: AddingStudentWithExistingNumberShouldThrow
public void AddingStudentWithExistingNumberShouldThrow()
{
var school = new School("Greendale");
var studentOne = new Student("Peshkata", 10000);
school.AddStudent(studentOne);
var studentTwo = new Student("Goshkata", 10000);
school.AddStudent(studentTwo);
}
示例15: Test_SchoolShouldThrowExceptionWhenAddingStudentWithDuplicateId
public void Test_SchoolShouldThrowExceptionWhenAddingStudentWithDuplicateId()
{
var school = new School("Telerik Academy");
var student = new Student("Pepo", 54321);
var otherStudent = new Student("Joro", 54321);
school.AddStudent(student);
school.AddStudent(otherStudent);
}