public void ShouldCreateNewEntityInRepository() { var newsAppSvc = new NewsAppService(mapper, newsRepositoryMock.Object); var vm = new NewsViewModel() { Title = "Title Test", Description = "Description Test" }; newsAppSvc.Create(vm); newsRepositoryMock.Verify(o => o.Insert(It.IsAny <NewsEntity>()), Times.Once); Assert.Pass(); }
public NewsController(NewsAppService newAppService) { _newAppService = newAppService; }