本文整理汇总了C#中School类的典型用法代码示例。如果您正苦于以下问题:C# School类的具体用法?C# School怎么用?C# School使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
School类属于命名空间,在下文中一共展示了School类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestIfSchoolNameIfSetCorrectlyAfterCourseCreation
public void TestIfSchoolNameIfSetCorrectlyAfterCourseCreation()
{
School school = new School("8-mo osnovno");
school.Name = "PMG osnovno";
Assert.AreEqual("PMG osnovno", school.Name, string.Format("Expected school name on school creation PMG osnovno. Received {0}", school.Name));
}
示例2: Main
public static void Main()
{
Student student1 = new Student("Aaaa Bbb", 1);
Student student2 = new Student("Cccc Ddd", 2);
Student student3 = new Student("Eeee Fff", 3, "ZZZZZZZZZZZZZ");
Teacher teacher1 = new Teacher("Zzzz yyyy");
Teacher teacher2 = new Teacher("Xxxx wwww");
Discipline oop = new Discipline("oop", 12, 10, "AAAAAAAA");
Discipline csharp = new Discipline("Csharp", 20, 14);
Discipline java = new Discipline("Java", 15, 16);
teacher1.AddDisicipline(oop);
teacher1.AddDisicipline(csharp);
teacher2.AddDisicipline(oop);
teacher1.ListOfDisciplines.Add(java);
School mySchool = new School();
ClassInSchool myClass = new ClassInSchool("MyClassName");
myClass.AddStudent(student1);
myClass.AddStudent(student2);
myClass.AddStudent(student3);
myClass.RemoveStudent(student1);
myClass.AddTeacher(teacher1);
myClass.AddTeacher(teacher2);
mySchool.AddClass(myClass);
System.Console.WriteLine(myClass);
}
示例3: Test_RegisterStudentReturnsCorrectStudent
public void Test_RegisterStudentReturnsCorrectStudent()
{
var school = new School();
var student = school.RegisterStudent("pesho");
Assert.AreEqual("pesho", student.Name);
}
示例4: RemoveNonExistingCourseTest
public void RemoveNonExistingCourseTest()
{
List<Course> courses = new List<Course>();
School school = new School(courses);
Course javaScript = new Course("JavaScript");
school.RemoveCourse(javaScript);
}
示例5: TestSchoolName
public void TestSchoolName()
{
School telerik = new School("TelerikAcademy");
string expected = "TelerikAcademy";
Assert.AreEqual(expected, telerik.Name);
}
示例6: SetValue_ForInt32_ChangesCurrentValue
public void SetValue_ForInt32_ChangesCurrentValue()
{
var propMetadata = modelForType.GetPropertyMetadata(typeof(School).GetProperty("Rating"));
var inst = new School() { Rating = 7 };
propMetadata.SetValue(inst, 8);
Assert.AreEqual(8, inst.Rating);
}
示例7: Main
static void Main()
{
//Student test
//Console.WriteLine("Student test");
List<Student> studentsList = new List<Student>();
studentsList.Add(new Student("Vesi", 1231532));
studentsList.Add(new Student("Natalia", 462346));
studentsList.Add(new Student("Mitko", 0982374));
//Console.WriteLine(studentsList.Print());
//Teacher test
//Console.WriteLine("Teacher test");
List<Teacher> teachersList = new List<Teacher>();
teachersList.Add(new Teacher("prof. Petrov"));
teachersList.Add(new Teacher("doc. Hristov"));
teachersList.Add(new Teacher("as. Doneva"));
teachersList[0].AddDiscipline("Computer sciense", 4, 5);
teachersList[0].AddDiscipline("Hardware basics", 3, 2);
teachersList[1].AddDiscipline("C# Basics", 4, 4);
teachersList[1].AddDiscipline("C# OOP", 5, 5);
teachersList[2].AddDiscipline("Operating Systems", 3, 2);
//Console.WriteLine(teachersList.Print());
//Class test
//Console.WriteLine("Class test");
Class classA = new Class('A', teachersList, studentsList);
//Console.WriteLine(classA.ToString());
Class classB = new Class('B', teachersList, studentsList);
classB.Comments = "This is class B";
//School test
Console.WriteLine("School test:");
School TUES = new School();
TUES.AddClass(classA);
TUES.AddClass(classB);
Console.WriteLine(TUES.ToString());
}
示例8: AddingNewStudentShouldWorkCorrectly
public void AddingNewStudentShouldWorkCorrectly()
{
var school = new School("Greendale");
var student = new Student("Britta Perry", 10002);
school.AddStudent(student);
Assert.ReferenceEquals(student, school.Students.First());
}
示例9: School_Create_Exists
public void School_Create_Exists()
{
var school = new School(TestSchoolName);
Assert.AreEqual(TestSchoolName, school.Name, "School name doesn't exist. Something is wrong with School creation");
}
示例10: AddingExistingStudentShouldThrow
public void AddingExistingStudentShouldThrow()
{
var school = new School("Greendale");
var studentOne = new Student("Peshkata", 10000);
school.AddStudent(studentOne);
school.AddStudent(studentOne);
}
示例11: AddingNewCourseShouldWorkCorrectly
public void AddingNewCourseShouldWorkCorrectly()
{
var school = new School("Greendale");
var course = new Course("Grifting");
school.AddCourse(course);
Assert.AreSame(course, school.Courses.First());
}
示例12: SchoolShouldThrowInvalidOperationExceptionWhenTryingToAddAStudentTwice
public void SchoolShouldThrowInvalidOperationExceptionWhenTryingToAddAStudentTwice()
{
var school = new School("Gosho school");
var student = new Student("Gosho", 99999);
school.AddStudent(student);
school.AddStudent(student);
}
示例13: Main
static void Main()
{
Class firstClass = new Class("8b");
School school = new School("My school");
school.Classes.Add(firstClass);
//Console.WriteLine(school.ToString());
firstClass.FillWithStudents();
Teacher Joreto = new Teacher("Joreto");
Joreto.Disciplines.Add(new Discipline("Math", 1, 1));
Joreto.Disciplines.Add(new Discipline("Physic", 2, 3));
Joreto.Disciplines.Add(new Discipline("Drawing", 3, 3));
Teacher Pesho = new Teacher("Pesho");
Pesho.Disciplines.Add(new Discipline("Math", 1, 1));
Pesho.Disciplines.Add(new Discipline("Physic", 2, 3));
firstClass.Teachers.Add(Joreto);
firstClass.Teachers.Add(Pesho);
Console.WriteLine("Teacher");
Console.WriteLine(firstClass.Teachers.ToString());
Console.WriteLine(firstClass.ToString());
Console.WriteLine("end of haha");
Console.WriteLine(school.ToString());
Console.WriteLine(school.Classes[0].Teachers[0].ToString());
}
示例14: RemoveCourse_ThrowsExceptionWhenParameterNull
public void RemoveCourse_ThrowsExceptionWhenParameterNull()
{
List<Course> courses = new List<Course>();
School school = new School(courses);
Course javascript = new Course("Javascript");
school.RemoveCourse(javascript);
}
示例15: SchoolShouldAddStudentCorrectly
public void SchoolShouldAddStudentCorrectly()
{
var school = new School("Telerik Academy");
var student = new Student("John", "Doe", 12345);
school.AddStudent(student);
Assert.AreSame(student, school.Students.First());
}