public void ConfirmUpdate_Success() { var contextMock = new Mock <IDbContext>(); var hostingEnv = new Mock <IHostingEnvironment>(); var controller = new RequestController(contextMock.Object, hostingEnv.Object); var modelMock = MockCreateRequestViewModel(); var response = controller.ConfirmUpdate(modelMock); var result = response as ViewResult; Assert.IsType <ViewResult>(response); CheckModelValues(modelMock, (result.ViewData.Values.ElementAt(0) as CreateRequestViewModel)); }