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


C# School.Student类代码示例

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


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

示例1: StudentToStringTest

 public void StudentToStringTest()
 {
     var student = new Student("Pesho", 12345);
     string expected = "Student name is: Pesho, with id: 12345";
     string actual = student.ToString();
     Assert.AreEqual(expected, actual);
 }
开发者ID:slop3n,项目名称:TelerikAcademy,代码行数:7,代码来源:StudentTest.cs

示例2: Main

        static void Main()
        {
            School justSchool = new School("JustSchool");

            Teacher ivanov = new Teacher("Ivanov");
            Teacher metodiev = new Teacher("Metodiev");

            Student milko = new Student("Milko", 15);
            Student vasil = new Student("Vasil", 2);

            Class bClass = new Class("BClass");

            Discipline math = new Discipline("Math", 5, 10);
            Discipline chemistry = new Discipline("Chemistry", 5, 12);

            justSchool.Classes.Add(bClass);

            bClass.Students.Add(milko);
            bClass.Students.Add(vasil);
            bClass.Teachers.Add(ivanov);
            bClass.Teachers.Add(metodiev);

            ivanov.Disciplines.Add(math);
            metodiev.Disciplines.Add(chemistry);

            bClass.Comment = "Pros";
        }
开发者ID:Elinos,项目名称:TelerikAcademy,代码行数:27,代码来源:SchoolTest.cs

示例3: StudentShouldNotThrowWhenLeavingCourse

 public void StudentShouldNotThrowWhenLeavingCourse()
 {
     var course = new Course("testCourse");
     var st = new Student("Pesho", 15000);
     st.JoinCourse(course);
     st.LeaveCourse(course);
 }
开发者ID:tddold,项目名称:TelerikAcademy-5,代码行数:7,代码来源:StudentTests.cs

示例4: Main

        static void Main()
        {
            //Students
            Student firstStudent = new Student("Pesho", "Kamburov", 1);
            Student secondStudent = new Student("Galin", "Imamov", 2);

            Console.ForegroundColor = ConsoleColor.Green;
            Console.WriteLine("Students:");
            Console.ResetColor();
            Console.WriteLine(firstStudent.ToString());
            Console.WriteLine(secondStudent.ToString());
            //Teachers
            Teacher firstTeacher = new Teacher("Stefan", "Popov");
            firstTeacher.AddDiscipline(new Discipline("Math", 16, 10));
            firstTeacher.AddDiscipline(new Discipline("Physics", 20, 5));
            Teacher secondTeacher = new Teacher("Armin", "Van Buuren");
            secondTeacher.AddDiscipline(new Discipline("TechMusic", 15, 5));
            secondTeacher.AddDiscipline(new Discipline("Minimal", 18, 7));

            Console.ForegroundColor = ConsoleColor.Green;
            Console.WriteLine("\nTeachers:");
            Console.ResetColor();
            Console.WriteLine(firstTeacher.ToString());
            Console.WriteLine(secondTeacher.ToString());

            //School
            School school = new School();

            school.AddClass(new Class("12b", firstTeacher));
            school.AddClass(new Class("12a", secondTeacher));
        }
开发者ID:NikolaiMishev,项目名称:Telerik-Academy,代码行数:31,代码来源:ProgramMain.cs

示例5: AddStudent

 public void AddStudent(School school, Student student)
 {
     if (school.Courses.Single(x => x.Equals(this)) != null)
     {
         this.students.Add(student);
     }
 }
开发者ID:GenoGenov,项目名称:TelerikAcademyAssignments,代码行数:7,代码来源:Course.cs

示例6: StudentGroupShouldAddStudent

 public void StudentGroupShouldAddStudent()
 {
     var myClass = new StudentGroup("TelerikAcad");
     var student = new Student("Pe6o Ubaveca", Student.MinValidId);
     myClass.AddStudent(student);
     Assert.AreEqual(1, myClass.Students.Count);
 }
开发者ID:tddold,项目名称:TelerikAcademy-5,代码行数:7,代码来源:SchoolTests.cs

示例7: Main

        static void Main(string[] args)
        {
            Student first=new Student("Mariq","564710");
            Student second = new Student("Pesho", "111123", "Gouem pich");
            Student third = new Student("Ganka", "126578");
            Disciplines basic = new Disciplines(10, "C# programming", "This is the prepration level at SoftUni.");
            Disciplines intermediate = new Disciplines(20, "Object Oriented Programming");
            Disciplines advanced = new Disciplines(30, "Structures of data and Algorithms", "This is the third level in SoftUni.");
            List<Student> students = new List<Student>();
            students.Add(first);
            students.Add(second);
            students.Add(third);

            List<Disciplines>SetOne=new List<Disciplines>();
            SetOne.Add(intermediate);
            SetOne.Add(intermediate);
            SetOne.Add(advanced);
            Teacher Nakov = new Teacher("Nakov", SetOne, "Gouem pich too :)");
            Teacher Znaiko = new Teacher("Znaiko", SetOne);
            List<Teacher> teachers = new List<Teacher>();
            teachers.Add(Nakov);
            teachers.Add(Znaiko);
            Class begginers = new Class(teachers,students);
            
        }
开发者ID:petar-rusev,项目名称:OOP,代码行数:25,代码来源:TestSchool.cs

示例8: CheckIf_NextStudent_GetCorrectIDIncrement

        public void CheckIf_NextStudent_GetCorrectIDIncrement()
        {
            var student = new Student("Marmalad Palachinkov");
            var secondStudent = new Student("Siren Banicharov");

            Assert.IsTrue(student.UniqueID + 1 == secondStudent.UniqueID);
        }
开发者ID:Bvaptsarov,项目名称:Homework,代码行数:7,代码来源:StudentTest.cs

示例9: CompareToString

        public void CompareToString()
        {
            var student = new Student("Marmalad Palachinkov");

            Assert.AreEqual("Marmalad Palachinkov - " + student.UniqueID, student.ToString(),
                "ToString is not returning in correct format.");
        }
开发者ID:Bvaptsarov,项目名称:Homework,代码行数:7,代码来源:StudentTest.cs

示例10: TestTrivialStudentCase

        public void TestTrivialStudentCase()
        {
            Student s = new Student("Ivan", 12345);

            bool result = s.Name == "Ivan" && s.Id == 12345;
            Assert.IsTrue(result);
        }
开发者ID:bahtev,项目名称:TelerikAcademy,代码行数:7,代码来源:StudentTests.cs

示例11: RemoveStudent

        public void RemoveStudent(Student student)
        {
            Validator.ValidateIfNotNull(student, "student");
            Validator.ValidateIfStudentsExists(this, student);

            this.students.Remove(student);
        }
开发者ID:AYankova,项目名称:HQC,代码行数:7,代码来源:Course.cs

示例12: TestRemoveNotExistingStudent

        public void TestRemoveNotExistingStudent()
        {
            Course css = new Course("CSS", students);
            Student koko = new Student("Kaloyan", 88823);

            css.RemoveStudent(koko);
        }
开发者ID:VyaraGGeorgieva,项目名称:TelerikAcademy,代码行数:7,代码来源:CourseTest.cs

示例13: TestStudentConstructorName

 public void TestStudentConstructorName()
 {
     string name = "Pesho";
     int uniqueNumber = 10000;
     Student target = new Student(name, uniqueNumber);
     Assert.AreEqual(target.Name, "Pesho");
 }
开发者ID:RobinJS,项目名称:dotNET,代码行数:7,代码来源:StudentTest.cs

示例14: AddNewStudentWithTakenNumber

 public void AddNewStudentWithTakenNumber()
 {
     Student studentTest = new Student("Test", 10001);
     Student studentFest = new Student("fest", 10001);
     this.testingSchool.AddStudent(studentTest);
     this.testingSchool.AddStudent(studentFest);
 }
开发者ID:NikolaNikushev,项目名称:Lectures,代码行数:7,代码来源:StudentTest.cs

示例15: CourseCanNotRemoveAStudentThatItDoesntHave

        public void CourseCanNotRemoveAStudentThatItDoesntHave()
        {
            var course = new Course("math");
            var student = new Student("Pesho", 12345);

            course.RemoveStudent(student);
        }
开发者ID:,项目名称:,代码行数:7,代码来源:


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