Exemplo n.º 1
0
            public void Retrieve_post_title_with_many_h1_elements()
            {
                // Arrange
                var post = new TestablePost();
                post.Body = @"
                <h1>This is the title</h1>
                <h1>This is not the title</h1>
                <p>This is a paragraph</p>";

                // Act
                post.RetrieveTitle();

                // Assert
                Assert.That(post.Title, Is.EqualTo("This is the title"));
                Assert.That(post.Body, Is.EqualTo(@"

                <h1>This is not the title</h1>
                <p>This is a paragraph</p>"));
            }
Exemplo n.º 2
0
            public void Retrieve_post_title_when_h1_has_attributes()
            {
                // Arrange
                var post = new TestablePost();
                post.Body = @"
                <h1 id=""this-is-the-title"">This is the title</h1>
                <p>This is a paragraph</p>";

                // Act
                post.RetrieveTitle();

                // Assert
                Assert.That(post.Title, Is.EqualTo("This is the title"));
                Assert.That(post.Body, Is.EqualTo(@"

                <p>This is a paragraph</p>"));
            }