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


C# School.AddStudent方法代码示例

本文整理汇总了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);
 }
开发者ID:aliv59git,项目名称:HighQualityCodeMy,代码行数:7,代码来源:SchoolTest.cs

示例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);
 }
开发者ID:Hri100v,项目名称:Telerik-Academy,代码行数:7,代码来源:SchoolTest.cs

示例3: AddingExistingStudentShouldThrow

 public void AddingExistingStudentShouldThrow()
 {
     var school = new School("Greendale");
     var studentOne = new Student("Peshkata", 10000);
     school.AddStudent(studentOne);
     school.AddStudent(studentOne);
 }
开发者ID:mpenchev86,项目名称:Telerik-Academy,代码行数:7,代码来源:SchoolTests.cs

示例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!");
 }
开发者ID:NK-Hertz,项目名称:Telerik-Academy-2015,代码行数:7,代码来源:StudentAndCoursesTests.cs

示例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);
 }
开发者ID:deskuuu,项目名称:TelerikAcademy,代码行数:7,代码来源:ShoolTests.cs

示例6: SchoolShouldThrowExceptionWhenAddingExistingStudent

 public void SchoolShouldThrowExceptionWhenAddingExistingStudent()
 {
     var school = new School("Telerik Academy");
     var student = new Student("John", "Doe", 12345);
     school.AddStudent(student);
     school.AddStudent(student);
 }
开发者ID:MarinaGeorgieva,项目名称:TelerikAcademy,代码行数:7,代码来源:SchoolTests.cs

示例7: TestAddDuplicateStudentId

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

        school.AddStudent(new Student("Pesho", 50000));
        school.AddStudent(new Student("Pesho", 50000));
    }
开发者ID:sabrie,项目名称:TelerikAcademy,代码行数:7,代码来源:SchoolTests.cs

示例8: SchoolShouldThrowExceptionWhenAddingExistingStudent

 public void SchoolShouldThrowExceptionWhenAddingExistingStudent()
 {
     var school = new School("Telerik Academy");
     var student = new Student("Jane Dow", 99999);
     school.AddStudent(student);
     school.AddStudent(student);
 }
开发者ID:Vyara,项目名称:Telerik-High-Quality-Code-Homeworks,代码行数:7,代码来源:SchoolTest.cs

示例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);
 }
开发者ID:ivanvasilev,项目名称:Telerik-Academy-Homeworks,代码行数:8,代码来源:SchoolTest.cs

示例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);
 }
开发者ID:mariya-ivanova,项目名称:KPK-Homework,代码行数:8,代码来源:SchoolTests.cs

示例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);
 }
开发者ID:MarinaGeorgieva,项目名称:TelerikAcademy,代码行数:8,代码来源:SchoolTests.cs

示例12: AddingExistingStudentShouldThrow

        public void AddingExistingStudentShouldThrow()
        {
            School school = new School("Hogwards");
            Student student = new Student("Stamat", 10000);

            school.AddStudent(student);
            school.AddStudent(student);
        }
开发者ID:Rostech,项目名称:TelerikAcademyHomeworks,代码行数:8,代码来源:SchoolTests.cs

示例13: SchoolShouldThrowWhenAddedStudentAlreadyExists

        public void SchoolShouldThrowWhenAddedStudentAlreadyExists()
        {
            School telerikAcademy = new School("TelerikAcademy");
            Student gosho = new Student(10000, "Georgi", "Petrov");

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

示例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);
 }
开发者ID:mpenchev86,项目名称:Telerik-Academy,代码行数:8,代码来源:SchoolTests.cs

示例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);
 }
开发者ID:Hri100v,项目名称:Telerik-Academy,代码行数:8,代码来源:SchoolTest.cs


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