public void AddAssessmentDetails_Default() { // Arrange var controller = new AssessmentController(_ITrainingService, _IAssessmentService); // Act int assessmentPaperId = 1; int trainingNameId = 1; int courseId = 1; var result = (ActionResult)controller.AddAssessmentDetails(assessmentPaperId, courseId, trainingNameId, "abc"); // Assert Assert.IsInstanceOfType(result, typeof(ViewResult)); }
public void AddAssessmentDetails_ExistingAssessment() { // Arrange var controller = new AssessmentController(_ITrainingService, _IAssessmentService); // Act int assessmentPaperId = 1; int trainingNameId = 1; int courseId = 1; var result = (ActionResult)controller.AddAssessmentDetails(assessmentPaperId, courseId, trainingNameId, "Use Existing Assessment"); // Assert Assert.IsInstanceOfType(result, typeof(RedirectToRouteResult)); RedirectToRouteResult routeResult = result as RedirectToRouteResult; Assert.AreEqual(routeResult.RouteValues["action"], "UseExistingAssessment"); }