File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
src/GitVersion.Configuration.Tests/Configuration Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -185,6 +185,25 @@ public void ReturnConfigurationFilePathIfCustomConfigurationIsSet()
185185 config . ShouldNotBe ( Path . GetFullPath ( "Configuration/CustomConfig.yaml" ) ) ;
186186 }
187187
188+ [ TestCase ( null ) ]
189+ [ TestCase ( "" ) ]
190+ [ TestCase ( " " ) ]
191+ [ TestCase ( "Configuration/CustomConfig2.yaml" ) ]
192+ public void ReturnConfigurationFilePathIfCustomConfigurationIsSet_InvalidConfigurationFilePaths ( string ? configFile )
193+ {
194+ this . workingPath = this . repoPath ;
195+
196+ this . gitVersionOptions = new ( ) { ConfigurationInfo = { ConfigurationFile = configFile } } ;
197+ var sp = GetServiceProvider ( this . gitVersionOptions ) ;
198+ this . configFileLocator = sp . GetRequiredService < IConfigurationFileLocator > ( ) ;
199+ this . fileSystem = sp . GetRequiredService < IFileSystem > ( ) ;
200+
201+ using var _ = this . fileSystem . SetupConfigFile ( path : this . workingPath , fileName : ConfigFile ) ;
202+
203+ var config = this . configFileLocator . GetConfigurationFile ( this . workingPath ) ;
204+ config . ShouldNotBe ( null ) ;
205+ }
206+
188207 [ Test ]
189208 public void DoNotThrowWhenConfigFileIsInSubDirectoryOfRepoPath ( )
190209 {
You can’t perform that action at this time.
0 commit comments