public void NotHaveArticlesWithSameTitle()
        {
            var sut = new Author("nicm");

            // Act
            Article article1 = sut.BeginArticle("Article1");
            Article article2 = sut.BeginArticle("Article1");

            Assert.NotNull(article1);
            Assert.Null(article2);
        }
        public void BeginNewArticle()
        {
            var sut = new Author("nicm");

            // Act
            sut.BeginArticle("New article");

            Assert.Single(sut.Articles);
        }
        public void DeleteArticleByTitle()
        {
            var sut = new Author("nicm");

            sut.BeginArticle("new article");

            // Act
            sut.DeleteArticle("new article");

            Assert.Empty(sut.Articles);
        }
示例#4
0
        public AuthorRepositoryFake()
        {
            var nicm = new Author("nicm");

            nicm.BeginArticle("My article");
            var ems = new Author("ems");

            authors = new List <Author> {
                nicm,
                ems,
            };
        }