Skip to content

Commit ff419db

Browse files
committed
Fix ApiKeyResolver tests to isolate from system credential store
Add useLocalCredentialStore: false parameter to tests that expect no API key to prevent them from picking up real credentials stored in the system.
1 parent 251b0d9 commit ff419db

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

LocalizationManager.Tests/UnitTests/Configuration/ApiKeyResolverTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public void GetApiKey_EmptyProvider_ThrowsArgumentException()
3333
public void GetApiKey_NoConfiguration_ReturnsNull()
3434
{
3535
// Act
36-
var apiKey = ApiKeyResolver.GetApiKey("deepl", null);
36+
var apiKey = ApiKeyResolver.GetApiKey("deepl", null, useLocalCredentialStore: false);
3737

3838
// Assert
3939
Assert.Null(apiKey);
@@ -156,7 +156,7 @@ public void HasApiKey_WithoutKey_ReturnsFalse()
156156
};
157157

158158
// Act
159-
var hasKey = ApiKeyResolver.HasApiKey("deepl", config);
159+
var hasKey = ApiKeyResolver.HasApiKey("deepl", config, useLocalCredentialStore: false);
160160

161161
// Assert
162162
Assert.False(hasKey);
@@ -201,7 +201,7 @@ public void GetApiKeySource_FromConfig_ReturnsCorrectSource()
201201
};
202202

203203
// Act
204-
var source = ApiKeyResolver.GetApiKeySource("deepl", config);
204+
var source = ApiKeyResolver.GetApiKeySource("deepl", config, useLocalCredentialStore: false);
205205

206206
// Assert
207207
Assert.NotNull(source);
@@ -212,7 +212,7 @@ public void GetApiKeySource_FromConfig_ReturnsCorrectSource()
212212
public void GetApiKeySource_NoKey_ReturnsNull()
213213
{
214214
// Act
215-
var source = ApiKeyResolver.GetApiKeySource("deepl", null);
215+
var source = ApiKeyResolver.GetApiKeySource("deepl", null, useLocalCredentialStore: false);
216216

217217
// Assert
218218
Assert.Null(source);

0 commit comments

Comments
 (0)