本文整理汇总了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);
}
示例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";
}
示例3: StudentShouldNotThrowWhenLeavingCourse
public void StudentShouldNotThrowWhenLeavingCourse()
{
var course = new Course("testCourse");
var st = new Student("Pesho", 15000);
st.JoinCourse(course);
st.LeaveCourse(course);
}
示例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));
}
示例5: AddStudent
public void AddStudent(School school, Student student)
{
if (school.Courses.Single(x => x.Equals(this)) != null)
{
this.students.Add(student);
}
}
示例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);
}
示例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);
}
示例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);
}
示例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.");
}
示例10: TestTrivialStudentCase
public void TestTrivialStudentCase()
{
Student s = new Student("Ivan", 12345);
bool result = s.Name == "Ivan" && s.Id == 12345;
Assert.IsTrue(result);
}
示例11: RemoveStudent
public void RemoveStudent(Student student)
{
Validator.ValidateIfNotNull(student, "student");
Validator.ValidateIfStudentsExists(this, student);
this.students.Remove(student);
}
示例12: TestRemoveNotExistingStudent
public void TestRemoveNotExistingStudent()
{
Course css = new Course("CSS", students);
Student koko = new Student("Kaloyan", 88823);
css.RemoveStudent(koko);
}
示例13: TestStudentConstructorName
public void TestStudentConstructorName()
{
string name = "Pesho";
int uniqueNumber = 10000;
Student target = new Student(name, uniqueNumber);
Assert.AreEqual(target.Name, "Pesho");
}
示例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);
}
示例15: CourseCanNotRemoveAStudentThatItDoesntHave
public void CourseCanNotRemoveAStudentThatItDoesntHave()
{
var course = new Course("math");
var student = new Student("Pesho", 12345);
course.RemoveStudent(student);
}