public void LoginSuccessInstructor() { string testLastName = "Hounnou"; string testFirstName = "Koffi"; string testLogin = "******"; string testPwd = "ffiko"; string testMailAdresse = "*****@*****.**"; DateTime testHireDate = DateTime.Now; EntityGenerator generator = new EntityGenerator(dbContext); Instructor instructor = generator.CreateInstructorForLogin(testLastName, testFirstName, testLogin, testPwd, testMailAdresse, testHireDate); var result = controllerToTest.Login(testLogin, testPwd) as RedirectToRouteResult; Assert.That(result, Is.Not.Null); Assert.That(result.RouteValues["action"], Is.EqualTo("Details")); //Assert.That(controllerToTest.Session["UserName"], Is.Not.Null); }