public void RemoveCourseFromSchool() { var school = new School("Telerik Academy"); var javascript = new Course("Javascript"); var html = new Course("HTML"); school.AddCourse(javascript); school.AddCourse(html); school.RemoveCourse(html); string expected = school.ToString(); string actual = "Course number: 1\nCourse name: Javascript\n"; Assert.AreEqual(expected, actual); }
public void TestRemoveCourse() { School.School s = new School.School("foo"); Course c1 = new Course("Math"); Course c2 = new Course("Biology"); s.AddCourse(c1); s.AddCourse(c2); Course removed = s.RemoveCourse("Math"); Assert.AreEqual(removed, c1); }
public void TestAddingNullCourse() { School.School s = new School.School("MySchool"); Course c = null; s.AddCourse(c); }
public void TestAddExistingCourse() { List <Course> courses = new List <Course>() { new Course("HTML", this.students), new Course("CSS", this.students), new Course("C#", this.students), new Course("JS", this.students), }; School.School tu = new School.School("TU", courses); Course algo = new Course("Algorithms", students); tu.AddCourse(algo); tu.AddCourse(algo); }
public void TestAddCourse1() { School school = new School("Telerik"); Course course = new Course("JavaScript"); school.AddCourse(course); Assert.AreEqual(1, school.Courses.Count, "Course was not added successfully."); }
public void AddingCourseShouldIncreazeNumberOfCourses() { var school = new School(); var course = new Course("pesho"); school.AddCourse(course); Assert.AreEqual(1, school.CoursesCount, "Courses adding does not increaze count"); }
public void TestRemoveCourse2() { School school = new School("Telerik"); Course course = new Course("JavaScript"); school.AddCourse(course); school.RemoveCourse(new Course("Web")); Assert.AreEqual(0, school.Courses.Count, "Course was not removed successfully."); }
static void Main() { School school = new School("NPMG"); List<Disciple> disciplines = LoadDisciplines(); Teacher dimo = new Teacher("Dimo Padalski", disciplines); Course geography = new Course("Geography"); geography.AddTeacher(dimo); school.AddCourse(geography); Teacher dimo2 = new Teacher("Dimo Padalski II", disciplines); Course geography2 = new Course("Geography2"); geography2.AddTeacher(dimo2); school.AddCourse(geography2); Console.WriteLine(PrintSchoolInfo(school)); }
public void TestAddFewCourses() { School.School s = new School.School("PMG"); Course c1 = new Course("Math"); Course c2 = new Course("Physics"); Course c3 = new Course("Chemistry"); s.AddCourse(c1); s.AddCourse(c2); s.AddCourse(c3); bool result = s.Courses.Count == 3; result = result && s.Courses[0].Name == c1.Name; result = result && s.Courses[1].Name == c2.Name; result = result && s.Courses[2].Name == c3.Name; Assert.IsTrue(result); }
public void TestRemoveMissingStudent() { School.School s = new School.School("bar"); Course c = new Course("Math"); Course c1 = new Course("alpha"); Course c2 = new Course("beta"); s.AddCourse(c); s.AddCourse(c1); s.AddCourse(c2); Course removed = s.RemoveCourse("omega"); bool result = removed == null; result = result && s.Courses[0] == c && s.Courses[1] == c1 && s.Courses[2] == c2; Assert.IsTrue(result); }
public void InitializeSchool() { school = new School("School"); firstCourse = new Course("Math"); secondCourse = new Course("Bio"); firstStudent = new Student("Ivan", 20000); secondStudent = new Student("Maria", 20000); firstCourse.AddStudent(firstStudent); school.AddCourse(firstCourse); }
public void InitializeSchoolTest() { var school = new School("Telerik Academy"); var javascript = new Course("Javascript"); var pesho = new Student("Pesho", 10111); javascript.AddStudent(pesho); school.AddCourse(javascript); string expected = "Course number: 1\nCourse name: Javascript\nStudent name is: Pesho, with id: 10111\n"; string actual = school.ToString(); Assert.AreEqual(expected, actual); }
static void Main() { School school = new School("NPMG"); List <Disciple> disciplines = LoadDisciplines(); Teacher dimo = new Teacher("Dimo Padalski", disciplines); Course geography = new Course("Geography"); geography.AddTeacher(dimo); school.AddCourse(geography); Teacher dimo2 = new Teacher("Dimo Padalski II", disciplines); Course geography2 = new Course("Geography2"); geography2.AddTeacher(dimo2); school.AddCourse(geography2); Console.WriteLine(PrintSchoolInfo(school)); }
public void TestSeveralCoursesWithSameName() { School.School s = new School.School("bar"); Course c = new Course("Math"); Course c1 = new Course("alpha"); Course c2 = new Course("beta"); Course c3 = new Course("gama"); Course c4 = new Course("Math"); Course c5 = new Course("Math"); s.AddCourse(c); s.AddCourse(c1); s.AddCourse(c2); s.AddCourse(c3); s.AddCourse(c4); s.AddCourse(c5); Course removed = s.RemoveCourse("Math"); bool result = removed == c; result = result && s.Courses[0] == c1 && s.Courses[1] == c2 && s.Courses[2] == c3 && s.Courses[3] == c4 && s.Courses[4] == c5; Assert.IsTrue(result); }
public void TestAddNullCourse() { List <Course> courses = new List <Course>() { new Course("HTML", this.students), new Course("CSS", this.students), new Course("C#", this.students), new Course("JS", this.students), }; School.School tu = new School.School("TU", courses); tu.AddCourse(null); }
public void TestAddCourseWithValidCourse() { List <Course> courses = new List <Course>() { new Course("HTML", this.students), new Course("CSS", this.students), new Course("C#", this.students), new Course("JS", this.students), }; School.School academy = new School.School("Telerik Academy", courses); var hqc = new Course("High Quality Code", students); academy.AddCourse(hqc); Assert.AreEqual(academy.Courses[4], hqc); }
public void TestAddCourseWithValidCourse() { List<Course> courses = new List<Course>() { new Course("HTML", this.students), new Course("CSS", this.students), new Course("C#", this.students), new Course("JS", this.students), }; School.School academy = new School.School("Telerik Academy", courses); var hqc = new Course("High Quality Code", students); academy.AddCourse(hqc); Assert.AreEqual(academy.Courses[4], hqc); }
public void TestRemoveCourseWithValidCourse() { List<Course> courses = new List<Course>() { new Course("HTML", this.students), new Course("CSS", this.students), new Course("C#", this.students), new Course("JS", this.students), }; School.School tu = new School.School("TU", courses); Course js = new Course("JS Part 2", students); tu.AddCourse(js); tu.RemoveCourse(js); Assert.IsFalse(tu.Courses.Contains(js)); }
public void TestRemoveCourseWithValidCourse() { List <Course> courses = new List <Course>() { new Course("HTML", this.students), new Course("CSS", this.students), new Course("C#", this.students), new Course("JS", this.students), }; School.School tu = new School.School("TU", courses); Course js = new Course("JS Part 2", students); tu.AddCourse(js); tu.RemoveCourse(js); Assert.IsFalse(tu.Courses.Contains(js)); }
/// <summary> /// Main Method /// </summary> public static void Main() { School tmt = new School("TMT"); Course electricalEngeneering = new Course("Electrical Enceneering"); for (int i = 0; i < 10; i++) { electricalEngeneering.JoinCourse(new Student(string.Format("Student{0}", i), tmt.GetStugentId)); } tmt.AddCourse(electricalEngeneering); ConsolePrinter(tmt.ToString()); foreach (var course in tmt.ViewCourses()) { ConsolePrinter(course.ToString(), 3); foreach (var student in course.ViewStudents()) { ConsolePrinter(student.Value.ToString(), 6); } } }
public void AddDuplicatedCourse() { School school = new School(); school.AddCourse(new Course("lol")); school.AddCourse(new Course("lol")); }
public void AddCourse() { var school = new School(); school.AddCourse(new Course(ValidCourseName)); Assert.AreEqual(ValidCourseName, school.GetCourseByName(ValidCourseName).CourseName); }
public void TestAddExistingCourse() { List<Course> courses = new List<Course>() { new Course("HTML", this.students), new Course("CSS", this.students), new Course("C#", this.students), new Course("JS", this.students), }; School.School tu = new School.School("TU", courses); Course algo = new Course("Algorithms", students); tu.AddCourse(algo); tu.AddCourse(algo); }
public void TestAddNullCourse() { List<Course> courses = new List<Course>() { new Course("HTML", this.students), new Course("CSS", this.students), new Course("C#", this.students), new Course("JS", this.students), }; School.School tu = new School.School("TU", courses); tu.AddCourse(null); }
public void AddCourse() { School school = new School(); school.AddCourse(new Course("lol")); Assert.AreEqual("lol",school.GetCourseByName("lol").CourseName); }
public void AddCourseWithStudents() { var school = new School(); school.AddCourse(ValidCourseName, new Student(ValidName, 10000)); Assert.AreEqual(ValidCourseName, school.GetCourseByName(ValidCourseName).CourseName); }
public void TestAddCourse2() { School school = new School("Telerik"); school.AddCourse(null); }
public void AddCourseWithStudents() { School school = new School(); school.AddCourse("lol", new Student("lele", 10000), new Student("male", 10001)); Assert.AreEqual("lol", school.GetCourseByName("lol").CourseName); }
public void CanNotAddNullCourse() { var school = new School(); school.AddCourse(null); }
public void AddDuplicateCourse() { var school = new School(); school.AddCourse(new Course(ValidCourseName)); school.AddCourse(new Course(ValidCourseName)); }