コード例 #1
0
        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());
        }
コード例 #2
0
        public void TestRegisterUser()
        {
            var system = new UsersController(new BangaloreUniversityDate(), new User(Username, Password, this.Role));
            system.Logout();
            var result = system.Register(Username, Password, Password, this.Role.ToString());

            Assert.AreEqual("User newUsername registered successfully.", result.Display());
        }