當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。