public void idTestStartValue() { string name = "Petar Petrov"; int id = 10000; Student student = new Student(name, id); Assert.AreEqual(student.ID, 10000); }
public void StudentConstructorTestName() { string name = "Petar Petrov"; int id = 12345; Student student = new Student(name, id); Assert.AreEqual(student.Name, "Petar Petrov"); }
public void CourseRemoveStudentWhenTheListIsEmpty() { Course course = new Course("C#", new List<Student>()); Student student = new Student("Svetlin", 11111); course.RemoveStudent(student); Assert.AreEqual(0, course.Students.Count); }
public void idTestEndValue() { string name = "Petar Petrov"; int id = 99999; Student student = new Student(name, id); Assert.AreEqual(student.ID, 99999); }
public void SchoolAddStudentToSchoolRegularTest() { School school = new School(new List<Student>(), new List<Course>()); Student student = new Student("Svetlin", 11111); school.AddStudent(student); Assert.AreEqual(1, school.AllStudents.Count); }
public void AddStudentTestExistingStudent() { Course course = new Course("QualityCode"); Student petar = new Student("Petar Petrov", 12345); course.AddStudent(petar); course.AddStudent(petar); }
public void CourseConstructorTestListStudents() { Course course = new Course("QualityCode"); Student petar = new Student("Petar Petrov", 12345); course.AddStudent(petar); Assert.IsTrue(course.Students.Contains(petar)); }
public void CourseRemoveStudentRegularTest() { Course course = new Course("C#", new List<Student>()); Student student = new Student("Svetlin", 11111); course.AddStudent(student); course.RemoveStudent(student); Assert.AreEqual(0, course.Students.Count); }
public void CourseAddStudentWhenTheCourseIsFullTest() { Course course = new Course("C#", new List<Student>()); for (int i = 0; i < 40; i++) { Student student = new Student("Svetlin" + i, 11100 + i); course.AddStudent(student); } }
public void SchoolAddCertainStudentWhoExistsAlreadyTest() { School school = new School(new List<Student>(), new List<Course>()); Student student = new Student("Svetlin", 11111); Student student1 = new Student("Pesho", 11111); school.AddStudent(student); school.AddStudent(student1); Assert.AreEqual(1, school.AllStudents.Count); }
public void RemoveStudent(Student student) { if (!this.Students.Contains(student)) { throw new ArgumentException("The student does not exist in this course!"); } this.Students.Remove(student); }
public void CourseAddStudentAlreadyInTheCourseTest() { Course course = new Course("C#", new List<Student>()); Student student = new Student("Svetlin", 11111); Student student1 = new Student("Svetlin", 11111); course.AddStudent(student); course.AddStudent(student1); Assert.AreEqual(1,course.Students.Count); }
public void StudentJoinCourseRegularTest() { Course course = new Course("C#", new List<Student>()); Student student = new Student("Svetlin", 11111); student.JoinCourse(course); Assert.AreEqual(1, course.Students.Count); }
public void AddStudent(Student student) { int index = this.allStudents.FindIndex(stud => stud.UniqueNumber.Equals(student.UniqueNumber)); if (index == -1) { this.allStudents.Add(student); } else { throw new ArgumentException("Student with id" + student.UniqueNumber + "Exists","student.UniqueNumber"); } }
public void AddStudent(Student student) { if (this.Students.Contains(student)) { throw new ArgumentException("The student joined this course already!"); } if (this.Students.Count >= MaxStudents) { throw new ArgumentOutOfRangeException("The course is full!"); } this.Students.Add(student); }
public void AddStudent(Student student) { if (this.Students.Count + 1 < 30) { int index = this.Students.FindIndex(stud => stud.UniqueNumber.Equals(student.UniqueNumber)); if (index == -1) { this.Students.Add(student); } else { throw new ArgumentException("Student with id" + student.UniqueNumber + "Exists", "student.UniqueNumber"); } } else { throw new InvalidOperationException("Course is full"); } }
public void RemoveStudent(Student student) { this.AllStudents.Remove(student); }
public void RemoveStudentTest() { Course course = new Course("QualityCode"); course.AddStudent(new Student("Petar Petrov", 12345)); Student todor = new Student("Todor Todorov", 54321); course.AddStudent(todor); course.RemoveStudent(todor); Assert.IsTrue(course.Students.Count == 1); }
public void RemoveNonExistingStudentTest() { Course course = new Course("QualityCode"); Student petar = new Student("Petar Petrov", 12345); course.RemoveStudent(petar); }
public void StudentNameStringEmptyTest() { Student student = new Student("", 11111); }
public void StudentUniqueNumberOutOfRangeSmallerTest() { Student student = new Student("Svetlin", 111); }
public void idTestAboveEndValue() { string name = "Petar Petrov"; int id = 100000; Student student = new Student(name, id); }
public void idTestBelowStartValue() { string name = "Petar Petrov"; int id = 9999; Student student = new Student(name, id); }
public void CourseStudentsPropertyMoreThan30Test() { List<Student> students = new List<Student>(); for (int i = 0; i < 40; i++) { Student student = new Student("Svetlin"+i, 11100+i); students.Add(student); } Course course = new Course("C#", students); }
public void NameTestEmptyString() { string name = string.Empty; int id = 12345; Student student = new Student(name, id); }
public void NameTestNullValue() { string name = null; int id = 12345; Student student = new Student(name, id); }
public void ToStringTest() { string name = "Petar Petrov"; int id = 12345; Student student = new Student(name, id); string expected = "Student Petar Petrov, ID 12345; "; string result = student.ToString(); Assert.AreEqual(expected, result); }
public void CourseStudentsPropertyRegularTest() { List<Student> students = new List<Student>(); Student student = new Student("Svetlin", 11111); students.Add(student); Course course = new Course("C#", students); }
public void StudentNameAndUniqueNumberRegularTest() { Student student = new Student("Svetlin", 11111); Assert.AreEqual("Svetlin", student.Name); }