Skip to content

Commit a8c9e05

Browse files
committed
Added Test for tags in NewBlogPost
1 parent e2460d7 commit a8c9e05

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

LinkDotNet.Blog.UnitTests/Web/Shared/Admin/CreateNewBlogPostTests.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,12 @@ public void ShouldCreateNewBlogPostWhenValidDataGiven()
4040
[Fact]
4141
public void ShouldFillGivenBlogPost()
4242
{
43-
var blogPost = new BlogPostBuilder().WithTitle("Title").WithShortDescription("Desc").WithContent("Content").Build();
43+
var blogPost = new BlogPostBuilder()
44+
.WithTitle("Title")
45+
.WithShortDescription("Desc")
46+
.WithContent("Content")
47+
.WithTags("tag1", "tag2")
48+
.Build();
4449
BlogPost blogPostFromComponent = null;
4550
var cut = RenderComponent<CreateNewBlogPost>(
4651
p =>
@@ -55,6 +60,8 @@ public void ShouldFillGivenBlogPost()
5560
blogPostFromComponent.Title.Should().Be("My new Title");
5661
blogPostFromComponent.ShortDescription.Should().Be("Desc");
5762
blogPostFromComponent.Content.Should().Be("Content");
63+
blogPostFromComponent.Tags.Select(t => t.Content).Should().Contain("tag1");
64+
blogPostFromComponent.Tags.Select(t => t.Content).Should().Contain("tag2");
5865
}
5966

6067
[Fact]

0 commit comments

Comments
 (0)