public static void Setup(TestContext context) { var options = new DbContextOptionsBuilder <ApplicationDataContext>().UseInMemoryDatabase("BlogApp").Options; dataContext = new ApplicationDataContext(options); manageComments = new ManageComments(dataContext); commentsController = new CommentsController(manageComments); dataContext.BlogTopics.Add(new BlogTopic { Id = 1, Title = "Test Titile", Contents = "Blog body", PublishDateTime = DateTime.Now }); dataContext.SaveChanges(); }
public CommentsController(IManageComments manageComments) { this.manageComments = manageComments; }