public void AddStudentTest() { SchoolClass schoolClass = new SchoolClass("4A"); Student mockStudent = _mockery.NewMock<Student>("Ala", "Nowak"); schoolClass.AddStudent(mockStudent); List<Student> students = schoolClass.Students.ToList(); Assert.IsTrue(students.Contains(mockStudent)); }
public void FindPersonsBySurnameTest() { var target = new SchoolClass("4C"); var mockStudent = _mockery.NewMock<Student>("Ala", "Nowak"); var mockStudent2 = _mockery.NewMock<Student>("Marek", "Kowalski"); var mockTeacher = _mockery.NewMock<Teacher>("Jas", "Kowalski", "Matematyka"); target.AddStudent(mockStudent); target.AddStudent(mockStudent2); target.Teacher = mockTeacher; IEnumerable<Person> foundPersons = target.FindPersonsBySurname("Kowalski"); Assert.IsFalse(foundPersons.Contains(mockStudent)); Assert.IsTrue(foundPersons.Contains(mockStudent2)); Assert.IsTrue(foundPersons.Contains(mockTeacher)); }
public void AddClass(SchoolClass schoolClass) { _schoolClasses.Add(schoolClass); }