public void TestAllMethodCourseNoCourse() { var system = new CoursesController(new BangaloreUniversityDate(), new User(Username, Password, Role.Lecturer)); var result = system.All(); Assert.AreEqual("No courses.", result.Display()); }
public void TestAllMethodCourse() { var system = new CoursesController(new BangaloreUniversityDate(), new User(Username, Password, Role.Lecturer)); var expect = new StringBuilder(); expect.Append("All courses:").AppendLine(); expect.Append("Advanced C# (0 students)").AppendLine(); expect.Append("Java Basic (0 students)"); system.Create("Advanced C#"); system.Create("Java Basic"); var result = system.All(); Assert.AreEqual(expect.ToString(), result.Display().Trim()); }
public void TestAddStudentInCourse() { var system = new CoursesController(new BangaloreUniversityDate(), new User(Username, Password, Role.Lecturer)); var student = new UsersController(new BangaloreUniversityDate(), new User(Username, Password, Role)); student.Logout(); student.Register(Username, Password, Password, this.Role.ToString()); student.Login(Username, Password); system.Create("Advanced C#"); var result = system.Enroll(1); Assert.AreEqual("Student successfully enrolled in course Advanced C#.", result.Display()); }
public void TestCreateCourse() { var system = new CoursesController(new BangaloreUniversityDate(), new User(Username, Password, Role.Lecturer)); var result = system.Create("Advanced C#"); Assert.AreEqual("Course Advanced C# created successfully.", result.Display()); }