public void TestAddGroup() { for (int i = 0; i < 5; i++) { SubjectForTest1.AddGroup(i); } for (int i = 0; i < 3; i++) { SubjectForTest2.AddGroup(10 - i); } Assert.AreEqual(5, SubjectForTest1.GroupIds.Count); Assert.AreEqual(3, SubjectForTest2.GroupIds.Count); Assert.AreEqual(0, SubjectForTest1.GroupIds[0]); Assert.AreEqual(9, SubjectForTest2.GroupIds[1]); }
public void TestInit() { TestStudentRepository = new Repository <Student>(); TestSubjectRepository = new Repository <Subject>(); TestGroupRepository = new Repository <ISGroup>(); //Students test init; for (int i = 0; i < 30; i++) { Student std = new Student(i); std.Name = "Test" + i; std.Surname = "Student" + i; std.MobilePhone = "+3809312345" + i; TestStudentRepository.Add(std); } for (int i = 0; i < 3; i++) { ISGroup group = new ISGroup(i, 110 + i); for (int k = i * 10; k < 10 * (i + 1); k++) { group.AddStudent(k); } for (int j = 0; j < 5; j++) { Subject subj = new Subject(i * 10 + j); Teacher teacher = new Teacher(i * 10 + j); teacher.Name = "Name" + i; teacher.Surname = "Surname" + j; subj.SetTeacher(teacher.Id); subj.AddGroup(group.Id); group.AddTeacher(teacher.Id); TestSubjectRepository.Add(subj); } TestGroupRepository.Add(group); } TestSearchController = new SearchController(TestStudentRepository, TestGroupRepository, TestSubjectRepository); }