public void AddStudentTwiseTest() { Course course = new Course("Math"); Student student = new Student("Gosho", "Ivanov", 12345); course.AddStudent(student); course.AddStudent(student); }
public void AddingTheSameStudentMoreThanOnce_ThrowException() { var spirt = new Course("Spirt"); var student = new Student("Peter"); spirt.AddStudent(student); spirt.AddStudent(student); }
public void RemoveStudentInCourse() { Course course = new Course("lala"); course.AddStudent(new Student("lol", 10000)); course.RemoveStudentByUID(10000); course.AddStudent(new Student("lol", 10000)); }
private static void Main() { try { Student pesho = new Student("Pesho Georgiev"); Student gosho = new Student("Gosho Ivanov"); Student misho = new Student("Misho Cekov"); Student sasho = new Student("Sasho Kostov"); Course telerikAcademy = new Course("Telerik Academy"); Course webProgramming = new Course("Web Programming"); webProgramming.AddStudent(sasho); telerikAcademy.AddStudent(pesho); telerikAcademy.AddStudent(gosho); telerikAcademy.AddStudent(misho); telerikAcademy.RemoveStudent(gosho); Console.WriteLine(gosho.ToString() + " was removed from course."); Console.WriteLine("Courses:"); Console.WriteLine(telerikAcademy); School freeSchool = new School("School of Computer Sciences"); freeSchool.AddCourse(webProgramming); freeSchool.AddCourse(telerikAcademy); } catch (Exception ex) { Console.WriteLine(ex.Message); } }
static void Main(string[] args) { List <Course> courses = new List <Course>(); //initialize student classes Student Mike = new Student("Mike", 254377, 18); Student Nicole = new Student("Nicole", 331988, 18); Student Samara = new Student("Samara", 229916, 18); Student Cezar = new Student("Cezar", 492151, 18); Student Senada = new Student("Senada", 737321, 18); //initialize courses Course Bio = new Course("Biology", "Mr. Franklin"); Course Chem = new Course("Chemistry", "Mr. Dettloff"); //add courses to course list courses.Add(Bio); courses.Add(Chem); //add students to courses Bio.AddStudent(Mike); Bio.AddStudent(Cezar); Bio.AddStudent(Senada); Chem.AddStudent(Nicole); Chem.AddStudent(Samara); foreach (Course course in courses) { Console.WriteLine("\nCourse: {0}\nInstructor: {1}", course.CourseTitle, course.Instructor); course.PrintStudents(); } Console.ReadLine(); }
public void CourseCanNotContainAStudentMoreThanOnce() { var course = new Course("math"); var student = new Student("Pesho", 12345); course.AddStudent(student); course.AddStudent(student); }
public void CourseAddingAnAlreadyExistingStudentShouldThrow() { var course = new Course("Just a course"); var student = new Student("Captain Nemo", 12000); course.AddStudent(student); course.AddStudent(student); }
public void TestAddStudentException() { Course html = new Course("HTML", students); Student pesho = new Student("Peter", 29345); Student gosho = new Student("Georgi", 99922); html.AddStudent(pesho); html.AddStudent(gosho); }
public void TestAddStudent2() { Course course = new Course("Telerik Academy"); Student misho = new Student("Misho Ivanov"); Student pesho = new Student("Pesho Ivanov"); pesho.Number = misho.Number; course.AddStudent(misho); course.AddStudent(pesho); }
public void TestAddStudent4() { Course course = new Course("Telerik Academy"); Student misho = new Student("Misho Ivanov"); Student pesho = new Student("Pesho Ivanov"); course.AddStudent(misho); course.AddStudent(pesho); Assert.IsTrue(course.ListOfStudents.Count == 2); }
public void AddingOneStudentTwiceShouldMakeCourseHaveOnlyOneStudent() { var student = new Student("Pesho"); var course = new Course(); course.AddStudent(student); course.AddStudent(student); Assert.AreEqual(1, course.StudentsCount); }
public void CourseAddingMoreThanThirtyStudentsShouldThrow() { var course = new Course("1337 sP33cH Course"); for (int i = 0; i < 30; i++) { course.AddStudent(new Student(string.Format("Robot P" + i + "esho" + i), 13337 + i)); } course.AddStudent(new Student("Cptn Nemo", 10001)); }
public void CourseToStringTest() { var course = new Course("C# HQC"); var pesho = new Student("Pesho", 10132); var gosho = new Student("Gosho", 10123); course.AddStudent(pesho); course.AddStudent(gosho); string expected = "Course name: C# HQC\nStudent name is: Pesho, with id: 10132\nStudent name is: Gosho, with id: 10123\n"; string actual = course.ToString(); Assert.AreEqual(expected, actual); }
public void Test_CourseAddStudentsWithNotUniqueNumberShouldThrow() { var firstName = "Jhon"; var lastName = "Minkov"; var studentNumber = 19999; var student = new Student(firstName, lastName, studentNumber); var course = new Course("CSharp"); course.AddStudent(student); var invalidStudent = new Student("Ivo", "Kenov", 19999); course.AddStudent(invalidStudent); }
public void CourseRemoveStudentTest() { var course = new Course("Javascript"); var pesho = new Student("Pesho", 10131); var gosho = new Student("Gosho", 10132); course.AddStudent(pesho); course.AddStudent(gosho); course.RemoveStudent(gosho); var actual = course.ToString(); var expected = "Course name: Javascript\nStudent name is: Pesho, with id: 10131\n"; Assert.AreEqual(expected, actual); }
public void AddExistingStudentToCourse() { Course math = new Course("Math"); testingSchool.AddCourse(math); testingCourses.Add(math); this.testingStudents.Add(new Student("Pesho", 10000)); testingStudents[0].AddCourse(math); math.AddStudent(testingStudents[0]); math.AddStudent(testingStudents[0]); }
public void AddStudentInFullClassTest() { Course course = new Course("Math"); string firstName = "Test"; string lastName = "Testov"; for (int i = 0; i < 30; i++) { course.AddStudent(new Student(firstName, lastName, 10000 + i)); } Student student = new Student("Gosho", "Ivanov", 12345); course.AddStudent(student); }
public void AddStudentTestThirtyOneStudents() { List<Student> studentList = new List<Student>(); Course courseThirtyOneStudents = new Course(studentList); for (int i = 0; i < 30; i++) { courseThirtyOneStudents.AddStudent(new Student("Pesho", 10000 + i)); } Student studentPesho = new Student("Pesho", 10031); courseThirtyOneStudents.AddStudent(studentPesho); }
public void TestUniqueIndentifier() { Course c = new Course("C# programming"); Student s1 = new Student("Niki", 12345); Student s2 = new Student("Doncho", 12346); Student s3 = new Student("George", 12347); Student s4 = new Student("Svetlin", 12347); c.AddStudent(s1); c.AddStudent(s2); c.AddStudent(s3); c.AddStudent(s4); }
static void Main(string[] args) { Console.WriteLine("Welcome back to School!"); Console.WriteLine(); Student josh = new Student("Josh"); Student matt = new Student("Matt"); Student zak = new Student("Zak"); Course csharp = new Course(4, "csharp"); Course python = new Course(3, "python"); csharp.AddStudent(josh); python.AddStudent(matt); python.AddStudent(zak); python.AddStudent(zak); josh.AddGrade(4, 4); josh.AddGrade(3, 4); matt.AddGrade(3, 3); zak.AddGrade(3, 4); Console.WriteLine(josh); Console.WriteLine(); Console.WriteLine(matt); Console.WriteLine(); Console.WriteLine(zak); Console.WriteLine(); Console.WriteLine(python.ToString()); Console.WriteLine(csharp.ToString()); Console.ReadLine(); //static void WriteResult(string name, double gpa) //{ // Console.WriteLine($"{name}: {gpa}", name, gpa); // Console.ReadLine(); //} //static void WriteResult(DateTime dateTime) //{ // Console.WriteLine(dateTime); // Console.ReadLine(); //} }
static void Main(string[] args) { Course math = new Course("Math"); for (int i = 0; i < 30; i++) { math.AddStudent(new Student("Test Student : " + i)); } Console.WriteLine(math); math.RemoveStudentByID(10000); math.RemoveStudentByID(10001); math.RemoveStudentByID(10002); Console.WriteLine(math); //throw exception //math.RemoveStudentByID(9); SchoolDem PMG = new SchoolDem("PMG"); PMG.AddCourse(math); //throwing exceptions //PMG.AddCourse(math); //PMG.AddCourse(null); Console.WriteLine(PMG); var school = new SchoolDem("Banichka"); var course = new Course("Alg"); school.AddCourse(course); Console.WriteLine(school); }
public void AddStudentAtsCourseMethodTest() { Course course = new Course("Math"); Student student = new Student("Gosho", "Ivanov", 12345); course.AddStudent(student); Assert.AreEqual(student.ID, course.ListOfStudents[0].ID); }
static void Main(string[] args) { Student Taemin = new Student("Taemin"); Student Onew = new Student("Onew"); List <Student> students = new List <Student>() { Taemin }; Course SHINee = new Course("SHINee", "Lee Soo Man", students); SHINee.AddStudent(Onew); Console.WriteLine(SHINee.Name); Console.WriteLine(SHINee.Professor); Taemin.AddGrade(5, 100); Taemin.AddGrade(5, 90); Console.WriteLine(Taemin.GetGradeLevel()); //Console.WriteLine(Taemin.Gpa); //set to private Console.WriteLine(Taemin); //Taemin (Credits: 10, GPA: 95) Onew.AddGrade(3, 80); Console.WriteLine(SHINee); Console.WriteLine(Taemin.Equals(Taemin)); Console.WriteLine(Taemin.Equals(Onew)); }
public static void Main() { Course cSharp = new Course("C#"); Student pesho = new Student("Pesho Peshev", 12345); Student gosho = new Student("Gosho Goshev", 13451); cSharp.AddStudent(pesho); cSharp.AddStudent(gosho); Course javaScript = new Course("JavaScript"); javaScript.AddStudent(pesho); javaScript.AddStudent(gosho); Student vankata = new Student("Vankata Vankov", 13124); javaScript.AddStudent(vankata); }
public void CourseRemovingInvalidStudentShouldThrow() { var course = new Course("course"); Student student = null; course.AddStudent(new Student("Captain Nemo", 12000)); course.RemoveStudent(student); }
public void CourseRemovingAStudentWhoHasntEnrolledInTheCourseShouldThrow() { var course = new Course("course"); var student = new Student("Captain Blackbeard", 10000); course.AddStudent(student); course.RemoveStudent(new Student("Captain Nemo", 12000)); }
public void MoreThan30Students() { Course course = new Course("lala"); for (int i = 0; i < 35; i++) { course.AddStudent(new Student(i.ToString(), 10000 + i)); } }
public void CourseShouldAddStudentCorrectly() { var course = new Course("Intermediate Pirate Speech"); var student = new Student("Captain Blackbeard", 55764); course.AddStudent(student); Assert.IsTrue(course.Students.Any(stud => stud.Name == student.Name && stud.Id == student.Id)); }
public void CourseCanNotContain30OrMoreStudents() { var course = new Course("math"); for (int i = 0; i < 30; i++) { course.AddStudent(new Student(i.ToString(), 10000 + i)); } }
public void TestMaxStudents() { Course c = new Course("Math"); for (int i = 0; i <= 30; i++) { c.AddStudent(new Student("Johny", 20000 + i)); } }
public void AddStudentTestOneStudent() { List<Student> studentList = new List<Student>(); Course courseOneStudent = new Course(studentList); Student studentPesho = new Student("Pesho", 10000); courseOneStudent.AddStudent(studentPesho); Assert.IsTrue(Course.students.Count == 1); }
public void CourseOverflowTest() { var course = new Course("C# HQC"); for (int i = 10100; i < 10135; i++) { course.AddStudent(new Student("Pesho", i)); } }
public void TestAddStudent3() { Course course = new Course("Telerik Academy"); Student misho = new Student("Misho Ivanov"); course.AddStudent(misho); Assert.AreEqual(1, course.ListOfStudents.Count, "Student was not added successfully."); }
public void AttendCourse(Course course) { if (course == null) { throw new ArgumentNullException("course", "Course cannot be null."); } course.AddStudent(this); }
public void JoinCourse(Course course) { if (course == null) { throw new ArgumentNullException("Course can not be null"); } course.AddStudent(this); }
public void JoinCourse(Course course) { if (course == null) { throw new NullReferenceException("Course cannot be null"); } course.AddStudent(this); }
public void JoinCourse(Course course) { if (course == null) { throw new ArgumentNullException("The course for adding a student should not be null"); } course.AddStudent(this); }
public void EnrollCourse(Course course) { if (course == null) { throw new ArgumentException("Course can not be null."); } course.AddStudent(this); }
public void SignCourse(Course course) { if (course == null) { throw new ArgumentNullException("Course cannot be null"); } this.courses.Add(course); if (!course.Students.Contains(this)) { course.AddStudent(this); } }
public void AttendCourse(Course course) { if (course == null) { throw new ArgumentNullException("course", "Course cannot be null."); } if (course.Students.Count >= maxStudents) { throw new InvalidOperationException("Students list is full"); } course.AddStudent(this); }
static void Main(string[] args) { bool keepRunning = true; Course course = new Course(); course.Name = "Software Engineering"; course.Room = "OIL1.60"; while (keepRunning) { Console.WriteLine("What is the first name?"); string firstName = Console.ReadLine(); Console.WriteLine("What is the last name?"); string LastName = Console.ReadLine(); Student student = new Student(); student.FirstName = firstName; student.LastName = LastName; course.AddStudent(student); Console.WriteLine(); Console.WriteLine("======================================"); Console.WriteLine($"For course with name {course.Name} in room {course.Room} the following students have signed up:"); foreach (Student studentInList in course.Students) { Console.WriteLine(studentInList.FirstName + " " + studentInList.LastName); } Console.WriteLine("======================================"); Console.WriteLine(); } // ZELF VERDER ONDERZOEKEN: // Properties // Encapsulation // Constructor }
public bool JoinCourse(Course course) { course.AddStudent(this); return(true); }
public void JoinCourse(Course course) { Validator.CheckIfNull(course, "Course to join"); course.AddStudent(this); }
public void JoinCourse(Course course) { course.AddStudent(this); }