public void Create() { var mock = new Mock <ILogger <BookController> >(); var dbcontext = new ApplicationDbContextFactory().CreateDbContext(new[] { "memory" }); var bookController = new BookController(mock.Object, dbcontext); Assert.NotNull(bookController); var res = bookController.Create(); Assert.NotNull(res); Assert.IsType <ViewResult>(res); bookController.Dispose(); }
public void TestCleanup() { _mockService = null; _controller.Dispose(); _controller = null; }