@@ -14,30 +14,30 @@ public class PublishingServiceTests
1414    private  const  string  StoreId  =  "storeId" ; 
1515
1616    [ Theory ] 
17-     [ InlineData ( false ,   "file.md" ) ] 
18-     [ InlineData ( true ,   "file.md-draft" ) ] 
19-     [ InlineData ( false ,   "file" ) ] 
20-     public  void  IsDraft_IsCorrect ( bool   isDraft ,   string   filename ) 
17+     [ InlineData ( "file.md" ,   false ) ] 
18+     [ InlineData ( "file.md-draft" ,   true ) ] 
19+     [ InlineData ( "file" ,   false ) ] 
20+     public  void  IsDraft_IsCorrect ( string   filename ,   bool   expectedIsDraft ) 
2121    { 
2222        var  contentService  =  new  Mock < IContentService > ( ) ; 
2323        var  sut  =  new  PublishingServices ( contentService . Object ) ; 
2424
2525        var  result  =  sut . IsDraft ( filename ) ; 
26-         Assert . Equal ( isDraft ,  result ) ; 
26+         Assert . Equal ( expectedIsDraft ,  result ) ; 
2727    } 
2828
2929    [ Theory ] 
30-     [ InlineData ( true ,   "file.md" ,  "file.md-draft" ) ] 
31-     [ InlineData ( true ,   "file.md-draft" ,  "file.md-draft" ) ] 
32-     [ InlineData ( false ,   "file.md" ,  "file.md" ) ] 
33-     [ InlineData ( false ,   "file.md-draft" ,  "file.md" ) ] 
34-     public  void  GetRelativeDraftUrlTests ( bool   isDraft ,   string   source ,  string  target ) 
30+     [ InlineData ( "file.md" ,   true ,  "file.md-draft" ) ] 
31+     [ InlineData ( "file.md-draft" ,   true ,  "file.md-draft" ) ] 
32+     [ InlineData ( "file.md" ,   false ,  "file.md" ) ] 
33+     [ InlineData ( "file.md-draft" ,   false ,  "file.md" ) ] 
34+     public  void  GetRelativeDraftUrlTests ( string   source ,   bool   isDraft ,  string  expectedTarget ) 
3535    { 
3636        var  contentService  =  new  Mock < IContentService > ( ) ; 
3737        var  sut  =  new  PublishingServices ( contentService . Object ) ; 
3838
3939        var  result  =  sut . GetRelativeDraftUrl ( source ,  isDraft ) ; 
40-         Assert . Equal ( target ,  result ) ; 
40+         Assert . Equal ( expectedTarget ,  result ) ; 
4141    } 
4242
4343    #region PublishingAsync
@@ -47,7 +47,7 @@ public async Task PublishingAsync_MakeDraft()
4747    { 
4848        var  ( sut ,  contentService )  =  GetPublishingService ( [ ( "file.md" ,  true ) ,  ( "file.md-draft" ,  false ) ] ) ; 
4949
50-         await  sut . PublishingAsync ( ContentType ,  StoreId ,  "file.md" ,  false ) ; 
50+         await  sut . PublishingAsync ( ContentType ,  StoreId ,  "file.md" ,  publish :   false ) ; 
5151
5252        contentService . Verify ( x =>  x . MoveContentAsync ( ContentType ,  StoreId ,  "file.md" ,  "file.md-draft" ) ,  Times . Exactly ( 1 ) ) ; 
5353        contentService . Verify ( x =>  x . DeleteContentAsync ( ContentType ,  StoreId ,  It . IsAny < string [ ] > ( ) ) ,  Times . Never ) ; 
@@ -58,7 +58,7 @@ public async Task PublishingAsync_PublishFile()
5858    { 
5959        var  ( sut ,  contentService )  =  GetPublishingService ( [ ( "file.md" ,  false ) ,  ( "file.md-draft" ,  true ) ] ) ; 
6060
61-         await  sut . PublishingAsync ( ContentType ,  StoreId ,  "file.md" ,  true ) ; 
61+         await  sut . PublishingAsync ( ContentType ,  StoreId ,  "file.md" ,  publish :   true ) ; 
6262
6363        contentService . Verify ( x =>  x . MoveContentAsync ( ContentType ,  StoreId ,  "file.md-draft" ,  "file.md" ) ,  Times . Exactly ( 1 ) ) ; 
6464        contentService . Verify ( x =>  x . DeleteContentAsync ( ContentType ,  StoreId ,  It . IsAny < string [ ] > ( ) ) ,  Times . Never ) ; 
@@ -69,7 +69,7 @@ public async Task PublishingAsync_PublishWhenPublishedExists()
6969    { 
7070        var  ( sut ,  contentService )  =  GetPublishingService ( [ ( "file.md" ,  true ) ,  ( "file.md-draft" ,  true ) ] ) ; 
7171
72-         await  sut . PublishingAsync ( ContentType ,  StoreId ,  "file.md" ,  true ) ; 
72+         await  sut . PublishingAsync ( ContentType ,  StoreId ,  "file.md" ,  publish :   true ) ; 
7373
7474        contentService . Verify ( x =>  x . MoveContentAsync ( ContentType ,  StoreId ,  "file.md-draft" ,  "file.md" ) ,  Times . Exactly ( 1 ) ) ; 
7575
@@ -82,7 +82,7 @@ public async Task PublishingAsync_DontUnpublishWithDraft()
8282    { 
8383        var  ( sut ,  contentService )  =  GetPublishingService ( [ ( "file.md" ,  true ) ,  ( "file.md-draft" ,  true ) ] ) ; 
8484
85-         await  sut . PublishingAsync ( ContentType ,  StoreId ,  "file.md" ,  false ) ; 
85+         await  sut . PublishingAsync ( ContentType ,  StoreId ,  "file.md" ,  publish :   false ) ; 
8686
8787        contentService . Verify ( x =>  x . MoveContentAsync ( ContentType ,  StoreId ,  It . IsAny < string > ( ) ,  It . IsAny < string > ( ) ) ,  Times . Never ) ; 
8888        contentService . Verify ( x =>  x . DeleteContentAsync ( ContentType ,  StoreId ,  It . IsAny < string [ ] > ( ) ) ,  Times . Never ) ; 
@@ -131,7 +131,7 @@ public async Task PublishStatusAsync_HasChanged()
131131    [ InlineData ( 1 ,  1 ,  1 ,  2 ,  "file1.md-draft" ,  "file2.md" ) ] 
132132    [ InlineData ( 2 ,  0 ,  1 ,  2 ,  "file1.md-draft" ,  "file1.md" ,  "file2.md" ) ] 
133133    [ InlineData ( 1 ,  1 ,  2 ,  2 ,  "file1.md-draft" ,  "file1.md" ,  "file2.md-draft" ) ] 
134-     public  async  Task  SetFileStatuses ( int  publishedCount ,  int  unpublishedCount ,  int  hasChangesCount ,  int  totalCount ,  params  string [ ]  filenames ) 
134+     public  async  Task  SetFileStatuses ( int  expectedPublishedCount ,  int  expectedUnpublishedCount ,  int  expectedHasChangesCount ,  int  expectedTotalCount ,  params  string [ ]  filenames ) 
135135    { 
136136        var  contentService  =  new  Mock < IContentService > ( ) ; 
137137        var  sut  =  new  PublishingServices ( contentService . Object ) ; 
@@ -149,10 +149,10 @@ ContentFile CreateContentFile(string filename)
149149
150150        var  result  =  ( await  sut . SetFilesStatuses ( files ) ) . ToList ( ) ; 
151151
152-         Assert . Equal ( publishedCount ,  result . Count ( x =>  x . Published ) ) ; 
153-         Assert . Equal ( unpublishedCount ,  result . Count ( x =>  ! x . Published ) ) ; 
154-         Assert . Equal ( hasChangesCount ,  result . Count ( x =>  x . HasChanges ) ) ; 
155-         Assert . Equal ( totalCount ,  result . Count ( ) ) ; 
152+         Assert . Equal ( expectedPublishedCount ,  result . Count ( x =>  x . Published ) ) ; 
153+         Assert . Equal ( expectedUnpublishedCount ,  result . Count ( x =>  ! x . Published ) ) ; 
154+         Assert . Equal ( expectedHasChangesCount ,  result . Count ( x =>  x . HasChanges ) ) ; 
155+         Assert . Equal ( expectedTotalCount ,  result . Count ( ) ) ; 
156156    } 
157157
158158    private  ( PublishingServices ,  Mock < IContentService > )  GetPublishingService ( ( string  Filename ,  bool  Exists ) [ ]  files ) 
0 commit comments