public void CallMapOnce() { // Arrange var mockedMappingService = new Mock <IMappingService>(); var mockedArticlesService = new Mock <IArticleService>(); var mockedUserService = new Mock <IUserService>(); string id = Guid.NewGuid().ToString(); var controller = new PanelController( mockedMappingService.Object, mockedUserService.Object, mockedArticlesService.Object); // Act controller.DeleteArticle(id); // Assert mockedMappingService.Verify(x => x.Map <IEnumerable <ArticleByIdViewModel> >(It.IsAny <IEnumerable <Article> >()), Times.Once); }
public void CallGetAllArticlesOnce() { // Arrange var mockedMappingService = new Mock <IMappingService>(); var mockedArticlesService = new Mock <IArticleService>(); var mockedUserService = new Mock <IUserService>(); string id = Guid.NewGuid().ToString(); var controller = new PanelController( mockedMappingService.Object, mockedUserService.Object, mockedArticlesService.Object); // Act controller.DeleteArticle(id); // Assert mockedArticlesService.Verify(x => x.GetAllArticles(), Times.Once); }