Skip to content

Commit cdb490c

Browse files
author
Furkan Küçük
committed
Configuration file path extracted into a variable for ReturnConfigurationFilePathIfCustomConfigurationIsSet test method
1 parent 0afd418 commit cdb490c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/GitVersion.Configuration.Tests/Configuration/ConfigurationFileLocatorTests.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,9 @@ public void DoNotThrowWhenWorkingAndRepoPathsAreSame_WithDifferentCasing()
157157
public void ReturnConfigurationFilePathIfCustomConfigurationIsSet()
158158
{
159159
this.workingPath = this.repoPath;
160+
string configurationFilePath = Path.Combine(this.workingPath, "Configuration", "CustomConfig.yaml");
160161

161-
this.gitVersionOptions = new() { ConfigurationInfo = { ConfigurationFile = Path.Combine(this.workingPath, "Configuration", "CustomConfig.yaml") } };
162+
this.gitVersionOptions = new() { ConfigurationInfo = { ConfigurationFile = configurationFilePath } };
162163

163164
var serviceProvider = GetServiceProvider(this.gitVersionOptions);
164165
this.fileSystem = serviceProvider.GetRequiredService<IFileSystem>();
@@ -169,7 +170,7 @@ public void ReturnConfigurationFilePathIfCustomConfigurationIsSet()
169170
this.configFileLocator = serviceProvider.GetRequiredService<IConfigurationFileLocator>();
170171

171172
var config = this.configFileLocator.GetConfigurationFile(this.workingPath);
172-
config.ShouldBe(Path.Combine(this.workingPath, "Configuration", "CustomConfig.yaml"));
173+
config.ShouldBe(configurationFilePath);
173174
}
174175

175176
[TestCase(null)]

0 commit comments

Comments
 (0)