public void Course_StudentIsExcluded() { Course<Student> mathCourse = new Course<Student>(); Student bratPit = new Student("Brat Pit", 10002); Student fracescoTotti = new Student("Francesco Totti", 10003); Student jessicaAlba = new Student("Jessica Alba", 10004); mathCourse[0] = bratPit; mathCourse[1] = fracescoTotti; mathCourse[2] = jessicaAlba; mathCourse.ExcludeParticipant(fracescoTotti); bool actual = true; for (int index = 0; index < 3; index++) { if (mathCourse[index] == fracescoTotti) { actual = false; break; } } Assert.IsTrue(actual,"Student is not removed from the course."); }
public static void Main(string[] args) { //Student pesho = new Student("Pesho"); //Console.WriteLine(pesho.Number); //Student gosho = new Student("Gosho"); //Console.WriteLine(gosho.Number); //Student vlado = new Student("Vlado"); //Console.WriteLine(vlado.Number); //Student kiro = new Student("Kiro"); //Console.WriteLine(kiro.Number); //Student simo = new Student("Simo"); //Console.WriteLine(simo.Number); //List<Student> students = new List<Student>(); //students.Add(pesho); //students.Add(gosho); //students.Add(vlado); List<Student> students = new List<Student>(); var student = new Student("Pesho"); students.Add(student); Course course = new Course(students); course.Leave(student); Console.WriteLine(); }
public void Course_30IsOutOfRangeIndex() { Course<Student> mathCourse = new Course<Student>(); Student student = new Student("Anonymous", 10008); mathCourse[30] = student; }
public void Course_Minus5IsOutOfRangeIndex() { Course<Student> mathCourse = new Course<Student>(); Student student = new Student("Anonymous", 10009); mathCourse[-5] = student; }
public void SchoolAddCourseTest() { School school = new School(); Course course = new Course("HQPC"); school.AddCourse(course); Assert.AreEqual("HQPC", course.Name, "Adding courses to school works incorrectly."); }
public void CrateCourse_CrateCourseAndGetItsCapacity() { int capacity = 10; Course course = new Course("css", 10); Assert.AreEqual(capacity, course.Capacity); }
public void TestConstructorNormalName() { Course course = new Course("Chemistry"); Assert.AreEqual("Chemistry", course.Name); Assert.AreEqual(0, course.EnrolledStudents.Count); }
public void TestAddStudentNormalTest() { Course course = new Course("Chemistry"); course.AddStudent(new Student("Hari", 11)); Assert.IsTrue(course.HasStudent(new Student("Hari", 11))); }
public void SchoolTestAddCourseSecondTime() { var course = new Course("Javascript"); var school = new School("Boby Georgiev"); school.AddCourse(course); school.AddCourse(course); }
public void CourseAddStudentExistingStudentTest() { Course course = new Course("HQPC"); Student student = new Student("Pesho Peshov", 11011); course.AddStudent(student); course.AddStudent(student); }
public void CourseTestAdd() { var student = new Student("Gosho Goshov", 12300); var course = new Course("Csharp"); course.AddStudent(student); course.AddStudent(student); }
public void AddOneCourse_ExpectToBeStored() { Course course = new Course(); this.school.AddCourse(course); Assert.AreEqual(1, this.school.Courses.Count, "Expect to have one course"); Assert.AreSame(course, this.school.Courses[0], "Expect the stored course to be the same"); }
public void Add31Students_ExpectToThrow() { Course course31 = new Course(); for (int i = 0; i <= 30; i++) { course31.AddStudent(new Student("Student" + i)); } }
public void AddNewStudent_AddTooManyStudents() { Course course = new Course("OS", 123); for (int i = 0; i < course.Capacity + 1; i++) { course.AddNewStudent(new Student((uint)i, "Gosho")); } }
public void CourseTestRemoveExistentStudent() { var student = new Student("Ivan Ivanov", 12300); var course = new Course("CMS"); course.AddStudent(student); course.RemoveStudent(student); }
public void AddNewStudent_AddTooMuchStudents() { Course course = new Course("OS", 123); Student student = new Student(10000, "Pesho"); Student studentWithSameID = new Student(10000, "Gosho"); course.AddNewStudent(student); course.AddNewStudent(studentWithSameID); }
public void SchoolTestRemoveExistentStudent() { var course = new Course("Javascript"); var school = new School("TUES"); school.AddCourse(course); school.RemoveCourse(course); }
public void CourseTestRemove() { var student = new Student("Ivan Ivanov", 12300); var student1 = new Student("Petkan Ivanov", 12100); var course = new Course("Csharp"); course.AddStudent(student); course.RemoveStudent(student1); }
public void CourseTestAddStudentToFullList() { var course = new Course("Javascript APIs"); for (var i = 1; i < 31; i++) { course.AddStudent(new Student("Test Student", i + 10000)); } }
public void SchoolAddStudentInCourseTest() { School cSharpSchool = new School("C# School"); Course cSharpCourse = new Course("C# Course"); cSharpSchool.AddCourse(cSharpCourse); Assert.AreEqual(1, cSharpSchool.CountOfCourses()); }
public void SchoolRemoveNotExistingStudentFromCourseTest() { School cSharpSchool = new School("C# School"); Course cSharpCourse = new Course("C# Course"); cSharpSchool.RemoveCourse(cSharpCourse); Assert.AreEqual(0, cSharpSchool.CountOfCourses()); }
public void SchoolTestRemoveNonExistingCourse() { var firstCourse = new Course("Javascript"); var secondCourse = new Course("Csharp"); var school = new School("TUES"); school.AddCourse(firstCourse); school.RemoveCourse(secondCourse); }
public void AddCourse(Course course) { if (course == null) { throw new ArgumentNullException("course", "Cannot add null as a course"); } this.Courses.Add(course); }
public void Course_StudentIsAdded() { Course<Student> mathCourse = new Course<Student>(); Student student = new Student("Anonymous", 10001); mathCourse[0] = student; bool actual = (mathCourse[0] == (student)); Assert.AreEqual(true, actual,"student is not added to the course."); }
public void OneStudentInCourseLeaves() { List<Student> students = new List<Student>(); students.Add(new Student("Petko", 12987)); Course course = new Course(); course.RemoveStudent(students[0]); }
public void CourseAddAlreadyExistStudentInCourseTest() { string name = "C# Course"; Student iliqn = new Student("Iliqn Dimitrov", 21475); Student dimitrov = new Student("Iliqn Dimitrov", 21475); Course cSharpCourse = new Course(name); cSharpCourse.AddStudent(iliqn); cSharpCourse.AddStudent(dimitrov); }
public void CourseAddStudentInCourseTest() { string name = "C# Course"; Student iliqn = new Student("Iliqn Dimitrov", 21475); Course cSharpCourse = new Course(name); cSharpCourse.AddStudent(iliqn); Assert.AreEqual(1, cSharpCourse.CountOfStudents()); }
public void AddCourse(Course course) { if (course == null) { throw new ArgumentNullException("Course can not be null"); } this.courses.Add(course); }
public void CheckLeaveMethod() { List<Student> students = new List<Student>(); var student = new Student("Pesho"); students.Add(student); Course course = new Course(students); course.Leave(student); Assert.AreEqual(0, course.Count); }
static void Main(string[] args) { School school = new School(); Course<Student> course = new Course<Student>(); Student student = new Student("A",10000); course[0] = student; school.AddCourse(course); }