Skip to content

Commit 6c33204

Browse files
committed
fix #864, make consts private
1 parent 9bc8e71 commit 6c33204

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

src/System.CommandLine.Suggest.Tests/DotnetSuggestEndToEndTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public DotnetSuggestEndToEndTests(ITestOutputHelper output)
5656

5757
_environmentVariables = new[] {
5858
("DOTNET_ROOT", _dotnetHostDir.FullName),
59-
(FileSuggestionRegistration.TestDirectroyOverride, _testRoot)};
59+
(TestDirectroyOverride: "INTERNAL_TEST_DOTNET_SUGGEST_HOME", _testRoot)};
6060
}
6161

6262
public void Dispose()

src/System.CommandLine.Suggest/FileSuggestionRegistration.cs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ namespace System.CommandLine.Suggest
1010
{
1111
public class FileSuggestionRegistration : ISuggestionRegistration
1212
{
13-
public const string ResgistrationFileName = ".dotnet-suggest-registration.txt";
14-
public const string TestDirectroyOverride = "INTERNAL_TEST_DOTNET_SUGGEST_HOME";
13+
private const string RegistrationFileName = ".dotnet-suggest-registration.txt";
14+
private const string TestDirectoryOverride = "INTERNAL_TEST_DOTNET_SUGGEST_HOME";
1515
private readonly string _registrationConfigurationFilePath;
1616

1717
public FileSuggestionRegistration(string registrationsConfigurationFilePath = null)
@@ -22,18 +22,16 @@ public FileSuggestionRegistration(string registrationsConfigurationFilePath = nu
2222
return;
2323
}
2424

25-
var testDirectoryOverride = GetEnvironmentVariable(TestDirectroyOverride);
25+
var testDirectoryOverride = GetEnvironmentVariable(TestDirectoryOverride);
2626
if (!string.IsNullOrWhiteSpace(testDirectoryOverride))
2727
{
28-
_registrationConfigurationFilePath = Path.Combine(testDirectoryOverride, ResgistrationFileName);
28+
_registrationConfigurationFilePath = Path.Combine(testDirectoryOverride, RegistrationFileName);
2929
return;
3030
}
3131

3232
var userProfile = GetFolderPath(SpecialFolder.UserProfile);
33-
if (userProfile != null)
34-
{
35-
_registrationConfigurationFilePath = Path.Combine(userProfile, ResgistrationFileName);
36-
}
33+
34+
_registrationConfigurationFilePath = Path.Combine(userProfile, RegistrationFileName);
3735
}
3836

3937
public Registration FindRegistration(FileInfo soughtExecutable)

0 commit comments

Comments
 (0)