From 753be43d11cd046fd5db6eb829d8aa61854b0bec Mon Sep 17 00:00:00 2001 From: Oleksandr Bezdieniezhnykh Date: Mon, 11 May 2026 23:41:31 +0300 Subject: [PATCH] [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 --- .../AuthenticationServiceCollectionExtensionsTests.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/SatelliteProvider.Tests/Authentication/AuthenticationServiceCollectionExtensionsTests.cs b/SatelliteProvider.Tests/Authentication/AuthenticationServiceCollectionExtensionsTests.cs index 893321b..5d2dcf2 100644 --- a/SatelliteProvider.Tests/Authentication/AuthenticationServiceCollectionExtensionsTests.cs +++ b/SatelliteProvider.Tests/Authentication/AuthenticationServiceCollectionExtensionsTests.cs @@ -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"));