public void TestRemoveStudentByUniqueNumber() { Course it = new Course("IT"); Student Ivan = new Student("ivan", 34597); it.AddStudent(Ivan); it.RemoveStudentByUniqueNumber(34597); }
public void TestAddStudentToCourse() { Course it = new Course("IT"); Student Ivan = new Student("ivan", 34587); it.AddStudent(Ivan); Assert.AreEqual(it.students.Count, 1); }
public void TestRemoveStudentByUniqueNumberThatDoesNotExist() { Course it = new Course("IT"); Student Ivan = new Student("ivan", 34517); it.AddStudent(Ivan); it.RemoveStudentByUniqueNumber(999999); }
public void TestStudentID() { //string name = "Mitaka"; int number = 65516; Student student = new Student(number); Assert.AreEqual(student.CourseNumber, number); }
public void TestCourseStudentAdd() { Student student = new Student("Mitko Mitev",61614); List<Student> list = new List<Student>(); list.Add(student); Assert.IsTrue(list.Contains(student)); }
public void TestStudentName() { string name = "Mitaka"; //int number = 65565; Student student = new Student(name); Assert.AreEqual(student.Name, name); }
public void AddStudent(Student student) { if (this.CheckifStudentExists(student.UniqueNumber)) { throw new ArgumentException(string.Format("Student with ID | {0} | already exists!", student.UniqueNumber)); } this.studentsInSchool.Add(student); }
public void TestAddStudentToFullCourse() { Course it = new Course("IT"); for (int i = 50000; i < 50032; i++) { Student Ivan = new Student("Ivan", i); it.AddStudent(Ivan); } }
public void TestCourseAddStudent() { List<Student> students = new List<Student>(); Course course = new Course(students); Student student = new Student("Mitko Mitev", 61614); //Course course = new Course(); course.AddStudents(student); Assert.IsTrue(course.Participants.Contains(student)); }
public void TestRemoveStudentt() { List<Student> students = new List<Student>(); Course course = new Course(students); Student student = new Student("Mitko Mitev", 61614); course.AddStudents(student); course.Remove(student); Assert.IsTrue(course.Participants.Count == 0); }
public void TestCourseAddStudents() { List<Student> students = new List<Student>(); Course course = new Course(students); Student student = new Student("Mitko Mitev", 61614); Student student1 = new Student("Krali Marko", 23237); course.AddStudents(student1); course.AddStudents(student); Assert.IsTrue(course.Participants.Count==2); }
public void TestCourseAddStudentTwise() { List<Student> students = new List<Student>(); Course course = new Course(students); Student student = new Student("Mitko Mitev", 61614); Student student1 = new Student("Mitko Mitev", 61614); course.AddStudents(student1); course.AddStudents(student); }
public void AddStudent(Student student) { if (students.Count <= 30) { students.Add(student); } else { throw new ArgumentOutOfRangeException("This course is full!"); } }
public static void AddStudent(Student student) { for (int i = 0; i < Students.Count; i++) { if (Students[i].UniqueNumber == student.UniqueNumber) { throw new ArgumentException("There is student with the same unique number!"); } } Students.Add(student); }
public void AddStudent(Student student) { if (this.CheckNumberOfStudents(this.students.Count)) { this.students.Add(student); } else { throw new ArgumentOutOfRangeException("Number of students in the course can't be more than 29!"); } }
public void TestCourseAddRemoveStudent() { Course course = new Course(); Student student = new Student("Pesho", 50000); for (int i = 0; i < 30; i++) { course.AddStudent(student); } course.RemoveStudent(student); }
public void RemoveStudent(Student student) { //Remove student that doesn't exists if (this.students.Count != 0) { this.students.Remove(student); } else { throw new ArgumentOutOfRangeException("In the course there are no students yet!"); } }
public void Remove(Student student) { bool found = this.IsStudentFound(student); if (!found) { throw new ArgumentException("There is not such a student"); } else { Participants.Remove(student); } }
public bool IsStudentFound(Student student) { bool found = false; for (int i = 0; i < Participants.Count; i++) { if (this.Participants[i].CourseNumber == student.CourseNumber) { found = true; } } return found; }
public void RemoveStudent(Course course, Student student) { if (!this.courses.Contains(course)) { throw new ArgumentException("No such course in school"); } var schoolCourse = this.courses.Find((x) => x == course); if (!schoolCourse.Students.Remove(student)) { throw new ArgumentException("No such student in course"); } }
public void AddStudents(Student student) { bool found = this.IsStudentFound(student); if(found) { throw new ArgumentException("This student is already in the course"); } else if (Participants.Count < MAX_STUDENTS_CLASS) { this.Participants.Add(student); } else { throw new ArgumentOutOfRangeException("There are not more free positions for the course "); } }
public static void Main() { var st = new Student("dada", 33424); var st1 = new Student("d22ada", 31424); var languageSchool = new School(); languageSchool.AddStudent(st); languageSchool.AddStudent(st1); var math = new Course(); math.AddStudent(st); math.AddStudent(st1); math.RemoveStudent(new Student("dddd", 23232)); languageSchool.AddCourse(math); languageSchool.RemoveCourse(math); languageSchool.AddCourse(math); }
public void AddStudent(Course course, Student student) { if (!this.courses.Contains(course)) { throw new ArgumentException("No such course in school"); } for (int i = 0; i < this.courses.Count; i++) { var currentCourse = this.courses[i]; for (int j = 0; j < currentCourse.Students.Count; j++) { if (student.Id == currentCourse.Students[j].Id) { throw new ArgumentException("There is already a student with the same id in the school"); } } } this.courses.Find((x) => x == course).Students.Add(student); }
public void TestFindStudent() { List<Student> students = new List<Student>(); Course course = new Course(students); Student student = new Student("Mitko Mitev", 61614); course.AddStudents(student); bool actual = course.IsStudentFound(student); Assert.AreEqual(true,actual); }
public void TestAddStudentWithSameUniqueNumber() { //The constructor of the class Student add new Student to School Student gosho = new Student("Gosho", 10001); Student tosho = new Student("Tosho Kato Gosho", 10001); }
public void TestAddMoreThanExpected() { List<Student> students = new List<Student>(); Course course = new Course(students); Student student = new Student("Mitko Mitev", 61614); for (int i = 10001; i < 10032; i++) { course.AddStudents(new Student("Marto",i)); } }
public void TestUniqueNumberOutOfRange() { Student Teodor = new Student("teodor", 11111); Teodor.UniqueNumber = 11111111; }
public void TestSetNameNull() { Student Teodor = new Student("teodor", 11111); Teodor.Name = null; }
public void TestCreateStudent() { Student Ivan = new Student("ivan", 34567); Assert.AreEqual(Ivan.Name, "ivan"); Assert.AreEqual(Ivan.UniqueNumber, 34567); }
public void RemoveStudent(Student student) { this.studentsInSchool.Remove(student); }