@@ -13,7 +13,7 @@ public sealed class SqlRepositoryTests : SqlDatabaseTestBase
1313 [ Fact ]
1414 public async Task ShouldLoadBlogPost ( )
1515 {
16- var blogPost = BlogPost . Create ( "Title" , "Subtitle" , "Content" , "url" , new [ ] { "Tag 1" , "Tag 2" } ) ;
16+ var blogPost = BlogPost . Create ( "Title" , "Subtitle" , "Content" , "url" , true , new [ ] { "Tag 1" , "Tag 2" } ) ;
1717 await DbContext . BlogPosts . AddAsync ( blogPost ) ;
1818 await DbContext . SaveChangesAsync ( ) ;
1919
@@ -24,6 +24,7 @@ public async Task ShouldLoadBlogPost()
2424 blogPostFromRepo . ShortDescription . Should ( ) . Be ( "Subtitle" ) ;
2525 blogPostFromRepo . Content . Should ( ) . Be ( "Content" ) ;
2626 blogPostFromRepo . PreviewImageUrl . Should ( ) . Be ( "url" ) ;
27+ blogPostFromRepo . IsPublished . Should ( ) . BeTrue ( ) ;
2728 blogPostFromRepo . Tags . Should ( ) . HaveCount ( 2 ) ;
2829 var tagContent = blogPostFromRepo . Tags . Select ( t => t . Content ) . ToList ( ) ;
2930 tagContent . Should ( ) . Contain ( new [ ] { "Tag 1" , "Tag 2" } ) ;
@@ -32,7 +33,7 @@ public async Task ShouldLoadBlogPost()
3233 [ Fact ]
3334 public async Task ShouldSaveBlogPost ( )
3435 {
35- var blogPost = BlogPost . Create ( "Title" , "Subtitle" , "Content" , "url" , new [ ] { "Tag 1" , "Tag 2" } ) ;
36+ var blogPost = BlogPost . Create ( "Title" , "Subtitle" , "Content" , "url" , true , new [ ] { "Tag 1" , "Tag 2" } ) ;
3637
3738 await BlogPostRepository . StoreAsync ( blogPost ) ;
3839
@@ -41,6 +42,7 @@ public async Task ShouldSaveBlogPost()
4142 blogPostFromContext . Title . Should ( ) . Be ( "Title" ) ;
4243 blogPostFromContext . ShortDescription . Should ( ) . Be ( "Subtitle" ) ;
4344 blogPostFromContext . Content . Should ( ) . Be ( "Content" ) ;
45+ blogPostFromContext . IsPublished . Should ( ) . BeTrue ( ) ;
4446 blogPostFromContext . PreviewImageUrl . Should ( ) . Be ( "url" ) ;
4547 blogPostFromContext . Tags . Should ( ) . HaveCount ( 2 ) ;
4648 var tagContent = blogPostFromContext . Tags . Select ( t => t . Content ) . ToList ( ) ;
@@ -50,7 +52,7 @@ public async Task ShouldSaveBlogPost()
5052 [ Fact ]
5153 public async Task ShouldGetAllBlogPosts ( )
5254 {
53- var blogPost = BlogPost . Create ( "Title" , "Subtitle" , "Content" , "url" , new [ ] { "Tag 1" , "Tag 2" } ) ;
55+ var blogPost = BlogPost . Create ( "Title" , "Subtitle" , "Content" , "url" , true , new [ ] { "Tag 1" , "Tag 2" } ) ;
5456 await DbContext . BlogPosts . AddAsync ( blogPost ) ;
5557 await DbContext . SaveChangesAsync ( ) ;
5658
@@ -63,6 +65,7 @@ public async Task ShouldGetAllBlogPosts()
6365 blogPostFromRepo . ShortDescription . Should ( ) . Be ( "Subtitle" ) ;
6466 blogPostFromRepo . Content . Should ( ) . Be ( "Content" ) ;
6567 blogPostFromRepo . PreviewImageUrl . Should ( ) . Be ( "url" ) ;
68+ blogPostFromRepo . IsPublished . Should ( ) . BeTrue ( ) ;
6669 blogPostFromRepo . Tags . Should ( ) . HaveCount ( 2 ) ;
6770 var tagContent = blogPostFromRepo . Tags . Select ( t => t . Content ) . ToList ( ) ;
6871 tagContent . Should ( ) . Contain ( new [ ] { "Tag 1" , "Tag 2" } ) ;
0 commit comments