From 680814169eecf5e348601af8e966201ac134b3db Mon Sep 17 00:00:00 2001 From: Xavier Date: Wed, 13 Aug 2025 14:42:10 -0700 Subject: [PATCH 1/8] Add Germany and China cloud --- Acl/src/EnvironmentOptions.cs | 2 +- Acl/src/EnvironmentOptionsExts/CloudType.cs | 16 +++++++++++++--- .../EnvironmentOptionsCosmosDbExt.cs | 2 +- .../EnvironmentOptionsKeyVaultExt.cs | 4 ++-- .../EnvironmentOptionsServiceBusExt.cs | 4 ++-- .../EnvironmentOptionsStorageExt.cs | 6 ++++-- Acl/tests/StorageNameTests.cs | 2 +- 7 files changed, 24 insertions(+), 12 deletions(-) diff --git a/Acl/src/EnvironmentOptions.cs b/Acl/src/EnvironmentOptions.cs index cda9dba..1dc6fec 100644 --- a/Acl/src/EnvironmentOptions.cs +++ b/Acl/src/EnvironmentOptions.cs @@ -10,5 +10,5 @@ public class EnvironmentOptions public string Environment { get; set; } = EnvironmentType.Test; - public string Cloud { get; set; } = CloudType.Public; + public string Cloud { get; set; } = CloudType.AzureCloud; } diff --git a/Acl/src/EnvironmentOptionsExts/CloudType.cs b/Acl/src/EnvironmentOptionsExts/CloudType.cs index 59b1cc6..f051f8f 100644 --- a/Acl/src/EnvironmentOptionsExts/CloudType.cs +++ b/Acl/src/EnvironmentOptionsExts/CloudType.cs @@ -8,10 +8,20 @@ public static class CloudType /// /// Represents the public cloud. /// - public const string Public = "public"; + public const string AzureCloud = nameof(AzureCloud); /// - /// Represents the Fairfax (US Government) cloud. + /// Represents the US Government cloud. /// - public const string Fairfax = "fairfax"; + public const string AzureUSGovernment = nameof(AzureUSGovernment); + + /// + /// Represents the Chine cloud. + /// + public const string AzureChinaCloud = nameof(AzureChinaCloud); + + /// + /// Represents the German cloud. + /// + public const string AzureGermanCloud = nameof(AzureGermanCloud); } diff --git a/Acl/src/EnvironmentOptionsExts/EnvironmentOptionsCosmosDbExt.cs b/Acl/src/EnvironmentOptionsExts/EnvironmentOptionsCosmosDbExt.cs index 5f13edd..8d2e88d 100644 --- a/Acl/src/EnvironmentOptionsExts/EnvironmentOptionsCosmosDbExt.cs +++ b/Acl/src/EnvironmentOptionsExts/EnvironmentOptionsCosmosDbExt.cs @@ -6,7 +6,7 @@ public static class EnvironmentOptionsCosmosDbExt public static string GetCosmosDbNameSharedUrl(this EnvironmentOptions settings) { - if (settings.Cloud == CloudType.Public) + if (settings.Cloud == CloudType.AzureCloud) return $"https://{GetCosmosDbNameShared(settings)}.documents.azure.com:443/"; throw new NotSupportedException($"Cloud type '{settings.Cloud}' is not supported."); diff --git a/Acl/src/EnvironmentOptionsExts/EnvironmentOptionsKeyVaultExt.cs b/Acl/src/EnvironmentOptionsExts/EnvironmentOptionsKeyVaultExt.cs index 48470c8..930c769 100644 --- a/Acl/src/EnvironmentOptionsExts/EnvironmentOptionsKeyVaultExt.cs +++ b/Acl/src/EnvironmentOptionsExts/EnvironmentOptionsKeyVaultExt.cs @@ -11,9 +11,9 @@ public static string GetKeyVaultUri(this EnvironmentOptions settings) var keyVaultName = settings.GetKeyVaultName(); switch (settings.Cloud) { - case CloudType.Public: + case CloudType.AzureCloud: return $"https://{keyVaultName}.vault.azure.net/"; - case CloudType.Fairfax: + case CloudType.AzureUSGovernment: return $"https://{keyVaultName}.vault.usgovcloudapi.net/"; default: throw new NotSupportedException($"Cloud type '{settings.Cloud}' is not supported for Key Vault URI generation."); diff --git a/Acl/src/EnvironmentOptionsExts/EnvironmentOptionsServiceBusExt.cs b/Acl/src/EnvironmentOptionsExts/EnvironmentOptionsServiceBusExt.cs index f8e6fd9..17a1210 100644 --- a/Acl/src/EnvironmentOptionsExts/EnvironmentOptionsServiceBusExt.cs +++ b/Acl/src/EnvironmentOptionsExts/EnvironmentOptionsServiceBusExt.cs @@ -6,9 +6,9 @@ public static class EnvironmentOptionsServiceBusExt public static string GetServiceBusNamespace(this EnvironmentOptions settings) { - if (settings.Cloud == CloudType.Public) + if (settings.Cloud == CloudType.AzureCloud) return $"{GetServiceBusName(settings)}.servicebus.windows.net"; - if (settings.Cloud == CloudType.Fairfax) + if (settings.Cloud == CloudType.AzureUSGovernment) return $"{GetServiceBusName(settings)}.servicebus.usgovcloudapi.net"; throw new NotSupportedException($"Cloud type '{settings.Cloud}' is not supported."); diff --git a/Acl/src/EnvironmentOptionsExts/EnvironmentOptionsStorageExt.cs b/Acl/src/EnvironmentOptionsExts/EnvironmentOptionsStorageExt.cs index a9fa1f7..087acc9 100644 --- a/Acl/src/EnvironmentOptionsExts/EnvironmentOptionsStorageExt.cs +++ b/Acl/src/EnvironmentOptionsExts/EnvironmentOptionsStorageExt.cs @@ -36,8 +36,10 @@ public static string GetBlobStorageSharedUrl(this EnvironmentOptions settings) return settings.Cloud switch { - CloudType.Public => $"https://{GetStorageNameShared(settings)}.blob.core.windows.net", - CloudType.Fairfax => $"https://{GetStorageNameShared(settings)}.blob.core.usgovcloudapi.net", + CloudType.AzureCloud => $"https://{GetStorageNameShared(settings)}.blob.core.windows.net", + CloudType.AzureUSGovernment => $"https://{GetStorageNameShared(settings)}.blob.core.usgovcloudapi.net", + CloudType.AzureChinaCloud => $"https://{GetStorageNameShared(settings)}.blob.core.chinacloud.cn", + CloudType.AzureGermanCloud => $"https://{GetStorageNameShared(settings)}.blob.core.cloudapi.de", _ => throw new NotSupportedException( $"Cloud type '{settings.Cloud}' is not supported for Blob Storage URL generation.") }; diff --git a/Acl/tests/StorageNameTests.cs b/Acl/tests/StorageNameTests.cs index 5164d55..73678e5 100644 --- a/Acl/tests/StorageNameTests.cs +++ b/Acl/tests/StorageNameTests.cs @@ -74,7 +74,7 @@ public void Will_get_blob_url_for_fairfax() Environment = EnvironmentType.Ppe, RegionShortName = "usw2", ServiceName = "bwf", - Cloud = CloudType.Fairfax + Cloud = CloudType.AzureUSGovernment }; var expectedUrl = $"https://ppestbwf.blob.core.usgovcloudapi.net"; From db49840d83912d8ed40a3f631307df000bbe5282 Mon Sep 17 00:00:00 2001 From: Xavier Date: Wed, 13 Aug 2025 15:55:35 -0700 Subject: [PATCH 2/8] Update storage test cases. --- Acl/tests/StorageNameTests.cs | 32 +++++++------------------------- 1 file changed, 7 insertions(+), 25 deletions(-) diff --git a/Acl/tests/StorageNameTests.cs b/Acl/tests/StorageNameTests.cs index 73678e5..b839c9f 100644 --- a/Acl/tests/StorageNameTests.cs +++ b/Acl/tests/StorageNameTests.cs @@ -27,26 +27,6 @@ public void Will_get_storage_name(string env) actual.Should().Be(expected); } - [Fact] - public void Will_get_blob_storage_url() - { - // Arrange - EnvironmentOptions environmentOptions = new() - { - Environment = EnvironmentType.Test, - RegionShortName = "usw2", - ServiceName = "bwf" - }; - - var expectedUrl = $"https://teststbwf.blob.core.windows.net"; - - // Act - var actualUrl = environmentOptions.GetBlobStorageSharedUrl(); - - // Assert - actualUrl.Should().Be(expectedUrl); - } - [Fact] public void Will_throw_exception_name_too_long() { @@ -65,8 +45,12 @@ public void Will_throw_exception_name_too_long() act.Should().Throw(); } - [Fact] - public void Will_get_blob_url_for_fairfax() + [Theory] + [InlineData(CloudType.AzureCloud, "https://ppestbwf.blob.core.windows.net")] + [InlineData(CloudType.AzureUSGovernment, "https://ppestbwf.blob.core.usgovcloudapi.net")] + [InlineData(CloudType.AzureChinaCloud, "https://ppestbwf.blob.core.chinacloud.cn")] + [InlineData(CloudType.AzureGermanCloud, "https://ppestbwf.blob.core.cloudapi.de")] + public void Will_get_blob_url_for_USGovernment(string cloudType, string expectedUrl) { // Arrange EnvironmentOptions environmentOptions = new() @@ -74,11 +58,9 @@ public void Will_get_blob_url_for_fairfax() Environment = EnvironmentType.Ppe, RegionShortName = "usw2", ServiceName = "bwf", - Cloud = CloudType.AzureUSGovernment + Cloud = cloudType }; - var expectedUrl = $"https://ppestbwf.blob.core.usgovcloudapi.net"; - // Act var actualUrl = environmentOptions.GetBlobStorageSharedUrl(); From 1da7db1f002bcdcad56ac290acec1bf5f2aef6ba Mon Sep 17 00:00:00 2001 From: Xavier Date: Wed, 13 Aug 2025 16:47:35 -0700 Subject: [PATCH 3/8] Test cases for CosmosDB --- .../EnvironmentOptionsCosmosDbExt.cs | 12 +++-- .../EnvironmentOptionsExt.cs | 4 +- Acl/tests/CosmosDbTests.cs | 51 +++++++++++++++++++ Acl/tests/StorageNameTests.cs | 2 +- 4 files changed, 62 insertions(+), 7 deletions(-) create mode 100644 Acl/tests/CosmosDbTests.cs diff --git a/Acl/src/EnvironmentOptionsExts/EnvironmentOptionsCosmosDbExt.cs b/Acl/src/EnvironmentOptionsExts/EnvironmentOptionsCosmosDbExt.cs index 8d2e88d..d76e740 100644 --- a/Acl/src/EnvironmentOptionsExts/EnvironmentOptionsCosmosDbExt.cs +++ b/Acl/src/EnvironmentOptionsExts/EnvironmentOptionsCosmosDbExt.cs @@ -6,9 +6,13 @@ public static class EnvironmentOptionsCosmosDbExt public static string GetCosmosDbNameSharedUrl(this EnvironmentOptions settings) { - if (settings.Cloud == CloudType.AzureCloud) - return $"https://{GetCosmosDbNameShared(settings)}.documents.azure.com:443/"; - - throw new NotSupportedException($"Cloud type '{settings.Cloud}' is not supported."); + return settings.Cloud switch + { + CloudType.AzureCloud => $"https://{GetCosmosDbNameShared(settings)}.documents.azure.com:443/", + CloudType.AzureUSGovernment => $"https://{GetCosmosDbNameShared(settings)}.documents.azure.us:443/", + CloudType.AzureChinaCloud => $"https://{GetCosmosDbNameShared(settings)}.documents.azure.cn:443/", + CloudType.AzureGermanCloud => $"https://{GetCosmosDbNameShared(settings)}.documents.azure.com:443/", + _ => throw new NotSupportedException($"Cloud type '{settings.Cloud}' is not supported.") + }; } } diff --git a/Acl/src/EnvironmentOptionsExts/EnvironmentOptionsExt.cs b/Acl/src/EnvironmentOptionsExts/EnvironmentOptionsExt.cs index 80d7ecb..3210ff5 100644 --- a/Acl/src/EnvironmentOptionsExts/EnvironmentOptionsExt.cs +++ b/Acl/src/EnvironmentOptionsExts/EnvironmentOptionsExt.cs @@ -2,6 +2,6 @@ public static class EnvironmentOptionsExt { - public static string GetResourceName(this EnvironmentOptions settings, string name) => $"{settings.Environment}-{settings.RegionShortName}-{name}-{settings.ServiceName}".ToLowerInvariant(); - public static string GetResourceNameShared(this EnvironmentOptions settings, string name) => $"{settings.Environment}-{name}-{settings.ServiceName}".ToLowerInvariant(); + public static string GetResourceName(this EnvironmentOptions settings, string resourceType) => $"{settings.Environment}-{settings.RegionShortName}-{resourceType}-{settings.ServiceName}".ToLowerInvariant(); + public static string GetResourceNameShared(this EnvironmentOptions settings, string resourceType) => $"{settings.Environment}-{resourceType}-{settings.ServiceName}".ToLowerInvariant(); } diff --git a/Acl/tests/CosmosDbTests.cs b/Acl/tests/CosmosDbTests.cs new file mode 100644 index 0000000..5be0b24 --- /dev/null +++ b/Acl/tests/CosmosDbTests.cs @@ -0,0 +1,51 @@ +namespace AntiCorruptionLayer.Tests; +using BestWeatherForecast.AntiCorruptionLayer; + +public class CosmosDbTests +{ + [Theory] + [InlineData("local")] + [InlineData("test")] + public void Will_get_CosmosDb_URL(string env) + { + // Arrange + EnvironmentOptions environmentOptions = new() + { + Environment = env, + RegionShortName = "usw2", + ServiceName = "bwf" + }; + + var expected = $"{env}-cosno-bwf"; + + // Act + var actual = environmentOptions.GetCosmosDbNameShared(); + + // Assert + actual.Should().Be(expected); + } + + [Theory] + [InlineData(CloudType.AzureCloud, "https://ppe-cosno-bwf.documents.azure.com:443/")] + [InlineData(CloudType.AzureUSGovernment, "https://ppe-cosno-bwf.documents.azure.us:443/")] + [InlineData(CloudType.AzureChinaCloud, "https://ppe-cosno-bwf.documents.azure.cn:443/")] + [InlineData(CloudType.AzureGermanCloud, "https://ppe-cosno-bwf.documents.azure.com:443/")] + public void Will_get_blob_url_for_Cloud(string cloudType, string expectedUrl) + { + // Arrange + EnvironmentOptions environmentOptions = new() + { + Environment = EnvironmentType.Ppe, + RegionShortName = "usw2", + ServiceName = "bwf", + Cloud = cloudType + }; + + // Act + var actualUrl = environmentOptions.GetCosmosDbNameSharedUrl(); + + // Assert + actualUrl.Should().Be(expectedUrl); + + } +} diff --git a/Acl/tests/StorageNameTests.cs b/Acl/tests/StorageNameTests.cs index b839c9f..b7df29e 100644 --- a/Acl/tests/StorageNameTests.cs +++ b/Acl/tests/StorageNameTests.cs @@ -50,7 +50,7 @@ public void Will_throw_exception_name_too_long() [InlineData(CloudType.AzureUSGovernment, "https://ppestbwf.blob.core.usgovcloudapi.net")] [InlineData(CloudType.AzureChinaCloud, "https://ppestbwf.blob.core.chinacloud.cn")] [InlineData(CloudType.AzureGermanCloud, "https://ppestbwf.blob.core.cloudapi.de")] - public void Will_get_blob_url_for_USGovernment(string cloudType, string expectedUrl) + public void Will_get_blob_url_for_Cloud(string cloudType, string expectedUrl) { // Arrange EnvironmentOptions environmentOptions = new() From c42ab116b97e94373f863eb4de333ddeb9b0e399 Mon Sep 17 00:00:00 2001 From: Xavier Date: Wed, 13 Aug 2025 16:51:16 -0700 Subject: [PATCH 4/8] KV --- .../EnvironmentOptionsKeyVaultExt.cs | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/Acl/src/EnvironmentOptionsExts/EnvironmentOptionsKeyVaultExt.cs b/Acl/src/EnvironmentOptionsExts/EnvironmentOptionsKeyVaultExt.cs index 930c769..e6f54a7 100644 --- a/Acl/src/EnvironmentOptionsExts/EnvironmentOptionsKeyVaultExt.cs +++ b/Acl/src/EnvironmentOptionsExts/EnvironmentOptionsKeyVaultExt.cs @@ -9,14 +9,17 @@ public static string GetKeyVaultUri(this EnvironmentOptions settings) ArgumentNullException.ThrowIfNull(settings); var keyVaultName = settings.GetKeyVaultName(); - switch (settings.Cloud) + + // Map cloud to the known Key Vault endpoint suffix + var dnsSuffix = settings.Cloud switch { - case CloudType.AzureCloud: - return $"https://{keyVaultName}.vault.azure.net/"; - case CloudType.AzureUSGovernment: - return $"https://{keyVaultName}.vault.usgovcloudapi.net/"; - default: - throw new NotSupportedException($"Cloud type '{settings.Cloud}' is not supported for Key Vault URI generation."); - } + CloudType.AzureCloud => "vault.azure.net", + CloudType.AzureUSGovernment => "vault.usgovcloudapi.net", + CloudType.AzureChinaCloud => "vault.azure.cn", + CloudType.AzureGermanCloud => "vault.microsoftazure.de", + _ => throw new NotSupportedException($"Cloud type '{settings.Cloud}' is not supported for Key Vault URI generation.") + }; + + return $"https://{keyVaultName}.{dnsSuffix}/"; } } From c92539c0c4445e28c811fd780f176d34882c91e7 Mon Sep 17 00:00:00 2001 From: Xavier Date: Wed, 13 Aug 2025 16:53:04 -0700 Subject: [PATCH 5/8] Service bus --- .../EnvironmentOptionsServiceBusExt.cs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Acl/src/EnvironmentOptionsExts/EnvironmentOptionsServiceBusExt.cs b/Acl/src/EnvironmentOptionsExts/EnvironmentOptionsServiceBusExt.cs index 17a1210..c91df2d 100644 --- a/Acl/src/EnvironmentOptionsExts/EnvironmentOptionsServiceBusExt.cs +++ b/Acl/src/EnvironmentOptionsExts/EnvironmentOptionsServiceBusExt.cs @@ -4,13 +4,13 @@ public static class EnvironmentOptionsServiceBusExt { public static string GetServiceBusName(this EnvironmentOptions settings) => settings.GetResourceNameShared("sbns"); - public static string GetServiceBusNamespace(this EnvironmentOptions settings) - { - if (settings.Cloud == CloudType.AzureCloud) - return $"{GetServiceBusName(settings)}.servicebus.windows.net"; - if (settings.Cloud == CloudType.AzureUSGovernment) - return $"{GetServiceBusName(settings)}.servicebus.usgovcloudapi.net"; - - throw new NotSupportedException($"Cloud type '{settings.Cloud}' is not supported."); - } + public static string GetServiceBusNamespace(this EnvironmentOptions settings) => + settings.Cloud switch + { + CloudType.AzureCloud => $"{settings.GetServiceBusName()}.servicebus.windows.net", + CloudType.AzureUSGovernment => $"{settings.GetServiceBusName()}.servicebus.usgovcloudapi.net", + CloudType.AzureChinaCloud => $"{settings.GetServiceBusName()}.servicebus.chinacloudapi.cn", + CloudType.AzureGermanCloud => $"{settings.GetServiceBusName()}.servicebus.cloudapi.de", + _ => throw new NotSupportedException($"Cloud type '{settings.Cloud}' is not supported.") + }; } From 4d6a55c15cc5699a7511bcbc056c45dc0143d760 Mon Sep 17 00:00:00 2001 From: Xavier Date: Wed, 13 Aug 2025 16:56:16 -0700 Subject: [PATCH 6/8] Fix test name --- Acl/tests/CosmosDbTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Acl/tests/CosmosDbTests.cs b/Acl/tests/CosmosDbTests.cs index 5be0b24..1f3dadd 100644 --- a/Acl/tests/CosmosDbTests.cs +++ b/Acl/tests/CosmosDbTests.cs @@ -30,7 +30,7 @@ public void Will_get_CosmosDb_URL(string env) [InlineData(CloudType.AzureUSGovernment, "https://ppe-cosno-bwf.documents.azure.us:443/")] [InlineData(CloudType.AzureChinaCloud, "https://ppe-cosno-bwf.documents.azure.cn:443/")] [InlineData(CloudType.AzureGermanCloud, "https://ppe-cosno-bwf.documents.azure.com:443/")] - public void Will_get_blob_url_for_Cloud(string cloudType, string expectedUrl) + public void Will_get_url_for_Cloud(string cloudType, string expectedUrl) { // Arrange EnvironmentOptions environmentOptions = new() From 9369f01d7aa5436572eaee4db2a9129eb823215d Mon Sep 17 00:00:00 2001 From: Xavier Date: Wed, 13 Aug 2025 17:01:49 -0700 Subject: [PATCH 7/8] Service Bus test cases --- Acl/tests/ServiceBusTests.cs | 51 ++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 Acl/tests/ServiceBusTests.cs diff --git a/Acl/tests/ServiceBusTests.cs b/Acl/tests/ServiceBusTests.cs new file mode 100644 index 0000000..e15c74a --- /dev/null +++ b/Acl/tests/ServiceBusTests.cs @@ -0,0 +1,51 @@ +namespace AntiCorruptionLayer.Tests; + +using BestWeatherForecast.AntiCorruptionLayer; + +public class ServiceBusTests +{ + [Theory] + [InlineData("local")] + [InlineData("test")] + public void Will_get_ServiceBus_name(string env) + { + // Arrange + EnvironmentOptions environmentOptions = new() + { + Environment = env, + RegionShortName = "usw2", + ServiceName = "bwf" + }; + + var expected = $"{env}-sbns-bwf"; + + // Act + var actual = environmentOptions.GetServiceBusName(); + + // Assert + actual.Should().Be(expected); + } + + [Theory] + [InlineData(CloudType.AzureCloud, "ppe-sbns-bwf.servicebus.windows.net")] + [InlineData(CloudType.AzureUSGovernment, "ppe-sbns-bwf.servicebus.usgovcloudapi.net")] + [InlineData(CloudType.AzureChinaCloud, "ppe-sbns-bwf.servicebus.chinacloudapi.cn")] + [InlineData(CloudType.AzureGermanCloud, "ppe-sbns-bwf.servicebus.cloudapi.de")] + public void Will_get_namespace_for_Cloud(string cloudType, string expectedNamespace) + { + // Arrange + EnvironmentOptions environmentOptions = new() + { + Environment = EnvironmentType.Ppe, + RegionShortName = "usw2", + ServiceName = "bwf", + Cloud = cloudType + }; + + // Act + var actualNamespace = environmentOptions.GetServiceBusNamespace(); + + // Assert + actualNamespace.Should().Be(expectedNamespace); + } +} From 927d3991e6c9dcce4ca90310c32ea99910db50ae Mon Sep 17 00:00:00 2001 From: Xavier Date: Wed, 13 Aug 2025 17:03:59 -0700 Subject: [PATCH 8/8] Test cases for KeyVault --- Acl/tests/KeyVaultTests.cs | 50 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 Acl/tests/KeyVaultTests.cs diff --git a/Acl/tests/KeyVaultTests.cs b/Acl/tests/KeyVaultTests.cs new file mode 100644 index 0000000..5414433 --- /dev/null +++ b/Acl/tests/KeyVaultTests.cs @@ -0,0 +1,50 @@ +namespace AntiCorruptionLayer.Tests; +using BestWeatherForecast.AntiCorruptionLayer; + +public class KeyVaultTests +{ + [Theory] + [InlineData("local")] + [InlineData("test")] + public void Will_get_KeyVault_name(string env) + { + // Arrange + EnvironmentOptions environmentOptions = new() + { + Environment = env, + RegionShortName = "usw2", + ServiceName = "bwf" + }; + + var expected = $"{env}-usw2-kv-bwf"; + + // Act + var actual = environmentOptions.GetKeyVaultName(); + + // Assert + actual.Should().Be(expected); + } + + [Theory] + [InlineData(CloudType.AzureCloud, "https://ppe-usw2-kv-bwf.vault.azure.net/")] + [InlineData(CloudType.AzureUSGovernment, "https://ppe-usw2-kv-bwf.vault.usgovcloudapi.net/")] + [InlineData(CloudType.AzureChinaCloud, "https://ppe-usw2-kv-bwf.vault.azure.cn/")] + [InlineData(CloudType.AzureGermanCloud, "https://ppe-usw2-kv-bwf.vault.microsoftazure.de/")] + public void Will_get_keyvault_uri_for_Cloud(string cloudType, string expectedUri) + { + // Arrange + EnvironmentOptions environmentOptions = new() + { + Environment = EnvironmentType.Ppe, + RegionShortName = "usw2", + ServiceName = "bwf", + Cloud = cloudType + }; + + // Act + var actualUri = environmentOptions.GetKeyVaultUri(); + + // Assert + actualUri.Should().Be(expectedUri); + } +}