/// <summary> /// Adds article. /// </summary> /// <param name="article">article</param> public void AddArticle(ArticleDto article) { if (article == null) { throw new ArgumentNullException(nameof(article)); } blog.AddArticle(article); }
public void AddArticleTest() { var article = new ArticleDto() { Id = 42, Header = "Head", Content = "Content" }; blog.AddArticle(article); Mock.Get(articleRepository) .Verify(repo => repo.Add(It.IsAny <Article>()), Times.Once); Mock.Get(articleRepository).VerifyNoOtherCalls(); uowMock.Verify(x => x.Commit(), Times.Once); }