mirror of
https://github.com/azaion/satellite-provider.git
synced 2026-06-21 09:01:16 +00:00
[AZ-487] fix: resolve CS0104 ambiguity in AuthN tests
`AuthenticationServiceCollectionExtensions` is also a built-in .NET type under `Microsoft.Extensions.DependencyInjection`. With both namespaces imported the unqualified references in this test file failed with CS0104, breaking the entire test project build. Resolved via a `using` alias so the call sites stay short while the build stays unambiguous. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+5
-4
@@ -8,6 +8,7 @@ using Microsoft.Extensions.Options;
|
||||
using Microsoft.IdentityModel.Tokens;
|
||||
using SatelliteProvider.Api.Authentication;
|
||||
using SatelliteProvider.Tests.TestUtilities;
|
||||
using AuthExtensions = SatelliteProvider.Api.Authentication.AuthenticationServiceCollectionExtensions;
|
||||
|
||||
namespace SatelliteProvider.Tests.Authentication;
|
||||
|
||||
@@ -18,13 +19,13 @@ public class AuthenticationServiceCollectionExtensionsTests : IDisposable
|
||||
|
||||
public AuthenticationServiceCollectionExtensionsTests()
|
||||
{
|
||||
_originalEnv = Environment.GetEnvironmentVariable(AuthenticationServiceCollectionExtensions.JwtSecretEnvVar);
|
||||
Environment.SetEnvironmentVariable(AuthenticationServiceCollectionExtensions.JwtSecretEnvVar, null);
|
||||
_originalEnv = Environment.GetEnvironmentVariable(AuthExtensions.JwtSecretEnvVar);
|
||||
Environment.SetEnvironmentVariable(AuthExtensions.JwtSecretEnvVar, null);
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
Environment.SetEnvironmentVariable(AuthenticationServiceCollectionExtensions.JwtSecretEnvVar, _originalEnv);
|
||||
Environment.SetEnvironmentVariable(AuthExtensions.JwtSecretEnvVar, _originalEnv);
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
|
||||
@@ -122,7 +123,7 @@ public class AuthenticationServiceCollectionExtensionsTests : IDisposable
|
||||
{
|
||||
// Arrange
|
||||
const string envSecret = "env-secret-also-longer-than-thirty-two-bytes-for-hmac";
|
||||
Environment.SetEnvironmentVariable(AuthenticationServiceCollectionExtensions.JwtSecretEnvVar, envSecret);
|
||||
Environment.SetEnvironmentVariable(AuthExtensions.JwtSecretEnvVar, envSecret);
|
||||
var services = new ServiceCollection();
|
||||
services.AddLogging();
|
||||
var configuration = BuildConfiguration(("Jwt:Secret", "config-secret-also-32-bytes-long-aaaaaaaaaa"));
|
||||
|
||||
Reference in New Issue
Block a user