Skip to content

Commit 5a00f5f

Browse files
author
Furkan Küçük
committed
Review suggestions applied
1 parent e103ad4 commit 5a00f5f

File tree

3 files changed

+9
-84
lines changed

3 files changed

+9
-84
lines changed

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

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,11 +175,17 @@ public void ReturnConfigurationFilePathIfCustomConfigurationIsSet()
175175
this.workingPath = this.repoPath;
176176

177177
this.gitVersionOptions = new() { ConfigurationInfo = { ConfigurationFile = "Configuration/CustomConfig.yaml" } };
178-
var sp = GetServiceProvider(this.gitVersionOptions);
179-
this.configFileLocator = sp.GetRequiredService<IConfigurationFileLocator>();
178+
179+
var serviceProvider = GetServiceProvider(this.gitVersionOptions);
180+
this.fileSystem = serviceProvider.GetRequiredService<IFileSystem>();
181+
182+
using var _ = this.fileSystem.SetupConfigFile(
183+
path: Path.Combine(this.workingPath, "Configuration"), fileName: "CustomConfig.yaml"
184+
);
185+
this.configFileLocator = serviceProvider.GetRequiredService<IConfigurationFileLocator>();
180186

181187
var config = this.configFileLocator.GetConfigurationFile(this.workingPath);
182-
config.ShouldNotBe(Path.GetFullPath("Configuration/CustomConfig.yaml"));
188+
Path.GetFileName(config).ShouldBe("CustomConfig.yaml");
183189
}
184190

185191
[TestCase(null)]

src/GitVersion.Configuration.Tests/Configuration/CustomConfig.yaml

Lines changed: 0 additions & 75 deletions
This file was deleted.

src/GitVersion.Configuration.Tests/GitVersion.Configuration.Tests.csproj

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,6 @@
44
<ProjectReference Include="..\GitVersion.Core.Tests\GitVersion.Core.Tests.csproj" />
55
</ItemGroup>
66

7-
<ItemGroup>
8-
<None Update="Configuration\CustomConfig.yaml">
9-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
10-
</None>
11-
</ItemGroup>
12-
137
<!-- Add the following target to copy the workflow files to the docs folder.
148
Whenever the Workflow changes, the docs folder will be updated with the latest version.
159
-->

0 commit comments

Comments
 (0)