Esempio n. 1
0
 public void ShouldConvertSpecialCharactersInItsSlugToDashes()
 {
     var article = new Article("$melly", "");
     article.Slug.Should().Be("-melly");
 }
Esempio n. 2
0
 public void ShouldLowerCaseAllCharactersInItsSlug()
 {
     var article = new Article("SMELlY", "");
     article.Slug.Should().Be("smelly");
 }
Esempio n. 3
0
 public void ShouldConvertLessThanToHtmlInTheBody()
 {
     var article = new Article("", "Clinton <");
     article.EscapedBody.Should().Be("Clinton &lt;");
 }
Esempio n. 4
0
 public void ShouldConvertGreaterThanToHtmlInTheBody()
 {
     var article = new Article("", "Sbu >");
     article.EscapedBody.Should().Be("Sbu &gt;");
 }
Esempio n. 5
0
 public void ShouldConvertAllSpacesToDashesInItsSlug()
 {
     var article = new Article("Deodorant saves world", "");
     article.Slug.Should().Be("deodorant-saves-world");
 }
Esempio n. 6
0
        public void ShouldSaveACommentToTheDatabaseWhenItIsAdded()
        {
            var article = new Article("", "");
            var comment = new Comment("TDD is cool");
            var database = new Mock<DatabaseService>();

            article.AddComment(database.Object, comment);

            database.Verify(db => db.Save(comment));
        }
Esempio n. 7
0
        public void ShouldNotSaveACommentWithShitInIt()
        {
            var article = new Article("", "");
            var comment = new Comment("this is shit....");
            var database = new Mock<DatabaseService>();

            article.AddComment(database.Object, comment);

            database.Verify(db => db.Save(comment), Times.Never());
        }