Пример #1
0
        public void When_AddBlogArticle_is_called_with_a_null_value_for_BlogArticle_then_an_ArgumentNullException_is_thrown()
        {
            BandRepository
            .Expect(repository =>
                    repository.AddBlogArticle(null))
            .Return(null)
            .Repeat.Never();
            BandRepository.Replay();

            Process.AddBlogArticle(null);

            BandRepository.VerifyAllExpectations();
        }
Пример #2
0
        public void When_AddBlogArticle_is_called_with_a_new_BlogArticle_then_AddBlogArticle_on_the_BandRepository_is_called_with_that_BlogArticle()
        {
            var article = BlogArticleCreator.CreateSingle();

            BandRepository
            .Expect(repository =>
                    repository.AddBlogArticle(article))
            .Return(article)
            .Repeat.Once();
            BandRepository.Replay();

            Process.AddBlogArticle(article);

            BandRepository.VerifyAllExpectations();
        }