@@ -97,32 +97,33 @@ public void DoNotBlowUpWhenDevelopAndFeatureBranchPointAtSameCommit()
97
97
fixture . AssertFullSemver ( "1.1.0-alpha.1" ) ;
98
98
}
99
99
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 )
105
103
{
106
104
using var fixture = new EmptyRepositoryFixture ( ) ;
107
105
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" ) ;
108
111
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 ) ;
119
114
120
115
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 ( ) ;
121
124
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 ) ;
126
127
}
127
128
}
128
129
}
0 commit comments