@@ -97,32 +97,33 @@ public void DoNotBlowUpWhenDevelopAndFeatureBranchPointAtSameCommit()
9797 fixture . AssertFullSemver ( "1.1.0-alpha.1" ) ;
9898 }
9999
100- [ TestCase ( true , false ) ]
101- [ TestCase ( true , true ) ]
102- [ TestCase ( false , false ) ]
103- [ TestCase ( false , true ) ]
104- public void HasDirtyFlagIfUncommittedChangesAreInRepo ( bool createTempFile , bool stageFile )
100+ [ TestCase ( true ) ]
101+ [ TestCase ( false ) ]
102+ public void HasDirtyFlagWhenUncommittedChangesAreInRepo ( bool stageFile )
105103 {
106104 using var fixture = new EmptyRepositoryFixture ( ) ;
107105 fixture . Repository . MakeACommit ( ) ;
106+
107+ var tempFile = Path . GetTempFileName ( ) ;
108+ var repoFile = Path . Combine ( fixture . RepositoryPath , Path . GetFileNameWithoutExtension ( tempFile ) + ".txt" ) ;
109+ File . Move ( tempFile , repoFile ) ;
110+ File . WriteAllText ( repoFile , "Hello world" ) ;
108111
109- if ( createTempFile )
110- {
111- var tempFile = Path . GetTempFileName ( ) ;
112- var repoFile = Path . Combine ( fixture . RepositoryPath , Path . GetFileNameWithoutExtension ( tempFile ) + ".txt" ) ;
113- File . Move ( tempFile , repoFile ) ;
114- File . WriteAllText ( repoFile , "Hello world" ) ;
115-
116- if ( stageFile )
117- Commands . Stage ( fixture . Repository , repoFile ) ;
118- }
112+ if ( stageFile )
113+ Commands . Stage ( fixture . Repository , repoFile ) ;
119114
120115 var version = fixture . GetVersion ( ) ;
116+ version . RepositoryDirtyFlag . ShouldBe ( "Dirty" ) ;
117+ }
118+
119+ [ Test ]
120+ public void NoDirtyFlagInCleanRepository ( )
121+ {
122+ using var fixture = new EmptyRepositoryFixture ( ) ;
123+ fixture . Repository . MakeACommit ( ) ;
121124
122- if ( createTempFile )
123- version . RepositoryDirtyFlag . ShouldBe ( "Dirty" ) ;
124- else
125- version . RepositoryDirtyFlag . ShouldBe ( null ) ;
125+ var version = fixture . GetVersion ( ) ;
126+ version . RepositoryDirtyFlag . ShouldBe ( null ) ;
126127 }
127128 }
128129}
0 commit comments