public void AddsEnvironmentWithStorageEndpoint()
        {
            Mock <ICommandRuntime> commandRuntimeMock = new Mock <ICommandRuntime>();

            SetupConfirmation(commandRuntimeMock);
            PSAzureEnvironment actual = null;

            commandRuntimeMock.Setup(f => f.WriteObject(It.IsAny <object>()))
            .Callback((object output) => actual = (PSAzureEnvironment)output);
            var cmdlet = new AddAzureRMEnvironmentCommand()
            {
                CommandRuntime         = commandRuntimeMock.Object,
                Name                   = "Katal",
                PublishSettingsFileUrl = "http://microsoft.com",
                StorageEndpoint        = "core.windows.net",
            };

            cmdlet.InvokeBeginProcessing();
            cmdlet.ExecuteCmdlet();
            cmdlet.InvokeEndProcessing();

            commandRuntimeMock.Verify(f => f.WriteObject(It.IsAny <PSAzureEnvironment>()), Times.Once());
            IAzureEnvironment env = AzureRmProfileProvider.Instance.Profile.GetEnvironment("KaTaL");

            Assert.Equal(env.Name, cmdlet.Name);
            Assert.Equal(env.GetEndpoint(AzureEnvironment.Endpoint.StorageEndpointSuffix), actual.StorageEndpointSuffix);
        }
Exemplo n.º 2
0
        public void CanConvertNullPSEnvironments()
        {
            PSAzureEnvironment env = null;

            Assert.Null((AzureEnvironment)env);
            var environment = (AzureEnvironment) new PSAzureEnvironment();

            Assert.NotNull(environment);
            Assert.False(environment.IsEndpointSet(AzureEnvironment.Endpoint.ActiveDirectory));
            Assert.False(environment.IsEndpointSet(AzureEnvironment.Endpoint.ActiveDirectoryServiceEndpointResourceId));
            Assert.False(environment.IsEndpointSet(AzureEnvironment.Endpoint.AdTenant));
            Assert.False(environment.IsEndpointSet(AzureEnvironment.Endpoint.AzureDataLakeAnalyticsCatalogAndJobEndpointSuffix));
            Assert.False(environment.IsEndpointSet(AzureEnvironment.Endpoint.AzureDataLakeStoreFileSystemEndpointSuffix));
            Assert.False(environment.IsEndpointSet(AzureEnvironment.Endpoint.AzureKeyVaultDnsSuffix));
            Assert.False(environment.IsEndpointSet(AzureEnvironment.Endpoint.AzureKeyVaultServiceEndpointResourceId));
            Assert.False(environment.OnPremise);
            Assert.False(environment.IsEndpointSet(AzureEnvironment.Endpoint.Gallery));
            Assert.False(environment.IsEndpointSet(AzureEnvironment.Endpoint.Graph));
            Assert.False(environment.IsEndpointSet(AzureEnvironment.Endpoint.GraphEndpointResourceId));
            Assert.False(environment.IsEndpointSet(AzureEnvironment.Endpoint.ManagementPortalUrl));
            Assert.Null(environment.Name);
            Assert.False(environment.IsEndpointSet(AzureEnvironment.Endpoint.PublishSettingsFileUrl));
            Assert.False(environment.IsEndpointSet(AzureEnvironment.Endpoint.ResourceManager));
            Assert.False(environment.IsEndpointSet(AzureEnvironment.Endpoint.ServiceManagement));
            Assert.False(environment.IsEndpointSet(AzureEnvironment.Endpoint.SqlDatabaseDnsSuffix));
            Assert.False(environment.IsEndpointSet(AzureEnvironment.Endpoint.StorageEndpointSuffix));
            Assert.False(environment.IsEndpointSet(AzureEnvironment.Endpoint.TrafficManagerDnsSuffix));
        }
Exemplo n.º 3
0
        /// <summary>
        /// Convert a context from a PSObject
        /// </summary>
        /// <param name="other"></param>
        public PSAzureContext(PSObject other)
        {
            if (other == null || other.Properties == null)
            {
                throw new ArgumentNullException(nameof(other));
            }
            PSObject property;

            if (other.TryGetProperty(nameof(Account), out property))
            {
                Account = new PSAzureRmAccount(property);
            }
            if (other.TryGetProperty(nameof(Environment), out property))
            {
                Environment = new PSAzureEnvironment(property);
            }
            if (other.TryGetProperty(nameof(Subscription), out property))
            {
                Subscription = new PSAzureSubscription(property);
            }
            if (other.TryGetProperty(nameof(Tenant), out property))
            {
                Tenant = new PSAzureTenant(property);
            }

            VersionProfile = other.GetProperty <string>(nameof(VersionProfile));
            this.PopulateExtensions(other);
        }
Exemplo n.º 4
0
        public void CreateEnvironmentWithTrailingSlashInActiveDirectory()
        {
            Mock <ICommandRuntime> commandRuntimeMock = new Mock <ICommandRuntime>();
            PSAzureEnvironment     actual             = null;

            commandRuntimeMock.Setup(f => f.WriteObject(It.IsAny <PSAzureEnvironment>()))
            .Callback((object output) => actual = (PSAzureEnvironment)output);
            var cmdlet = new AddAzureRMEnvironmentCommand()
            {
                CommandRuntime          = commandRuntimeMock.Object,
                Name                    = "Katal",
                ActiveDirectoryEndpoint = "https://ActiveDirectoryEndpoint/"
            };

            var dict = new Dictionary <string, object>();

            dict["ActiveDirectoryEndpoint"] = "https://ActiveDirectoryEndpoint/";
            cmdlet.SetBoundParameters(dict);
            cmdlet.SetParameterSet("Name");

            SetupConfirmation(commandRuntimeMock);
            cmdlet.InvokeBeginProcessing();
            cmdlet.ExecuteCmdlet();
            cmdlet.InvokeEndProcessing();
            Assert.Equal(cmdlet.ActiveDirectoryEndpoint, actual.ActiveDirectoryAuthority, StringComparer.OrdinalIgnoreCase);
        }
Exemplo n.º 5
0
        public void CanConvertProfieWithCustomEnvironment()
        {
            IAzureContext context         = new AzureContext(new AzureSubscription(), new AzureAccount(), new AzureEnvironment(), new AzureTenant(), new byte[0]);
            var           testContext     = new PSAzureContext(context);
            var           testEnvironment = new PSAzureEnvironment(AzureEnvironment.PublicEnvironments["AzureCloud"]);

            testEnvironment.Name = "ExtraEnvironment";
            var testProfile = new PSAzureProfile();

            testProfile.Context = testContext;
            testProfile.Environments.Add("ExtraEnvironment", testEnvironment);
            ConvertAndTestProfile(testProfile, (profile) =>
            {
                Assert.NotEmpty(profile.EnvironmentTable);
                Assert.True(profile.EnvironmentTable.ContainsKey("ExtraEnvironment"));
                Assert.NotEmpty(profile.Contexts);
                Assert.NotNull(profile.DefaultContext);
                Assert.NotEmpty(profile.DefaultContextKey);
                Assert.Equal("Default", profile.DefaultContextKey);
                Assert.Collection(profile.Environments.OrderBy(e => e.Name),
                                  (e) => Assert.Equal(e, AzureEnvironment.PublicEnvironments[EnvironmentName.AzureChinaCloud]),
                                  (e) => Assert.Equal(e, AzureEnvironment.PublicEnvironments[EnvironmentName.AzureCloud]),
                                  (e) => Assert.Equal(e, AzureEnvironment.PublicEnvironments[EnvironmentName.AzureGermanCloud]),
                                  (e) => Assert.Equal(e, AzureEnvironment.PublicEnvironments[EnvironmentName.AzureUSGovernment]),
                                  (e) => Assert.Equal(e, testEnvironment));
            });
        }
Exemplo n.º 6
0
        public void AddsEnvironmentWithStorageEndpoint()
        {
            var profile = new AzureSMProfile();
            Mock <ICommandRuntime> commandRuntimeMock = new Mock <ICommandRuntime>();
            PSAzureEnvironment     actual             = null;

            commandRuntimeMock.Setup(f => f.WriteObject(It.IsAny <object>()))
            .Callback((object output) => actual = (PSAzureEnvironment)output);
            AddAzureEnvironmentCommand cmdlet = new AddAzureEnvironmentCommand()
            {
                CommandRuntime         = commandRuntimeMock.Object,
                Name                   = "Katal",
                PublishSettingsFileUrl = "http://microsoft.com",
                StorageEndpoint        = "core.windows.net",
                Profile                = profile
            };

            cmdlet.InvokeBeginProcessing();
            cmdlet.ExecuteCmdlet();
            cmdlet.InvokeEndProcessing();

            commandRuntimeMock.Verify(f => f.WriteObject(It.IsAny <PSAzureEnvironment>()), Times.Once());
            ProfileClient    client = new ProfileClient(profile);
            AzureEnvironment env    = client.Profile.Environments["KaTaL"];

            Assert.Equal(env.Name, cmdlet.Name);
            Assert.Equal(env.Endpoints[AzureEnvironment.Endpoint.PublishSettingsFileUrl], actual.PublishSettingsFileUrl);
        }
        public void CanCreateEnvironmentWithAllProperties()
        {
            Mock <ICommandRuntime> commandRuntimeMock = new Mock <ICommandRuntime>();

            SetupConfirmation(commandRuntimeMock);
            PSAzureEnvironment actual = null;

            commandRuntimeMock.Setup(f => f.WriteObject(It.IsAny <PSAzureEnvironment>()))
            .Callback((object output) => actual = (PSAzureEnvironment)output);
            var cmdlet = new AddAzureRMEnvironmentCommand()
            {
                CommandRuntime          = commandRuntimeMock.Object,
                Name                    = "Katal",
                ActiveDirectoryEndpoint = "https://ActiveDirectoryEndpoint",
                AdTenant                = "AdTenant",
                AzureKeyVaultDnsSuffix  = "AzureKeyVaultDnsSuffix",
                ActiveDirectoryServiceEndpointResourceId = "https://ActiveDirectoryServiceEndpointResourceId",
                AzureKeyVaultServiceEndpointResourceId   = "https://AzureKeyVaultServiceEndpointResourceId",
                EnableAdfsAuthentication = true,
                GalleryEndpoint          = "https://GalleryEndpoint",
                GraphEndpoint            = "https://GraphEndpoint",
                ManagementPortalUrl      = "https://ManagementPortalUrl",
                PublishSettingsFileUrl   = "https://PublishSettingsFileUrl",
                ResourceManagerEndpoint  = "https://ResourceManagerEndpoint",
                ServiceEndpoint          = "https://ServiceEndpoint",
                StorageEndpoint          = "https://StorageEndpoint",
                SqlDatabaseDnsSuffix     = "SqlDatabaseDnsSuffix",
                TrafficManagerDnsSuffix  = "TrafficManagerDnsSuffix",
                GraphAudience            = "GaraphAudience"
            };

            cmdlet.InvokeBeginProcessing();
            cmdlet.ExecuteCmdlet();
            cmdlet.InvokeEndProcessing();
            Assert.Equal(cmdlet.Name, actual.Name);
            Assert.Equal(cmdlet.EnableAdfsAuthentication.ToBool(), actual.EnableAdfsAuthentication);
            Assert.Equal(cmdlet.ActiveDirectoryEndpoint + "/", actual.ActiveDirectoryAuthority, StringComparer.OrdinalIgnoreCase);
            Assert.Equal(cmdlet.ActiveDirectoryServiceEndpointResourceId,
                         actual.ActiveDirectoryServiceEndpointResourceId);
            Assert.Equal(cmdlet.AdTenant, actual.AdTenant);
            Assert.Equal(cmdlet.AzureKeyVaultDnsSuffix, actual.AzureKeyVaultDnsSuffix);
            Assert.Equal(cmdlet.AzureKeyVaultServiceEndpointResourceId, actual.AzureKeyVaultServiceEndpointResourceId);
            Assert.Equal(cmdlet.GalleryEndpoint, actual.GalleryUrl);
            Assert.Equal(cmdlet.GraphEndpoint, actual.GraphUrl);
            Assert.Equal(cmdlet.ManagementPortalUrl, actual.ManagementPortalUrl);
            Assert.Equal(cmdlet.PublishSettingsFileUrl, actual.PublishSettingsFileUrl);
            Assert.Equal(cmdlet.ResourceManagerEndpoint, actual.ResourceManagerUrl);
            Assert.Equal(cmdlet.ServiceEndpoint, actual.ServiceManagementUrl);
            Assert.Equal(cmdlet.StorageEndpoint, actual.StorageEndpointSuffix);
            Assert.Equal(cmdlet.SqlDatabaseDnsSuffix, actual.SqlDatabaseDnsSuffix);
            Assert.Equal(cmdlet.TrafficManagerDnsSuffix, actual.TrafficManagerDnsSuffix);
            Assert.Equal(cmdlet.GraphAudience, actual.GraphEndpointResourceId);
            commandRuntimeMock.Verify(f => f.WriteObject(It.IsAny <PSAzureEnvironment>()), Times.Once());
            AzureEnvironment env = AzureRmProfileProvider.Instance.Profile.Environments["KaTaL"];

            Assert.Equal(env.Name, cmdlet.Name);
        }
Exemplo n.º 8
0
        public void CanCreateEnvironmentWithAllProperties()
        {
            var profile = new AzureSMProfile();
            Mock <ICommandRuntime> commandRuntimeMock = new Mock <ICommandRuntime>();
            PSAzureEnvironment     actual             = null;

            commandRuntimeMock.Setup(f => f.WriteObject(It.IsAny <PSAzureEnvironment>()))
            .Callback((object output) => actual = (PSAzureEnvironment)output);
            AddAzureEnvironmentCommand cmdlet = new AddAzureEnvironmentCommand()
            {
                CommandRuntime          = commandRuntimeMock.Object,
                Name                    = "Katal",
                Profile                 = profile,
                ActiveDirectoryEndpoint = "ActiveDirectoryEndpoint",
                AdTenant                = "AdTenant",
                AzureKeyVaultDnsSuffix  = "AzureKeyVaultDnsSuffix",
                ActiveDirectoryServiceEndpointResourceId = "ActiveDirectoryServiceEndpointResourceId",
                AzureKeyVaultServiceEndpointResourceId   = "AzureKeyVaultServiceEndpointResourceId",
                EnableAdfsAuthentication = true,
                GalleryEndpoint          = "GalleryEndpoint",
                GraphEndpoint            = "GraphEndpoint",
                ManagementPortalUrl      = "ManagementPortalUrl",
                PublishSettingsFileUrl   = "PublishSettingsFileUrl",
                ResourceManagerEndpoint  = "ResourceManagerEndpoint",
                ServiceEndpoint          = "ServiceEndpoint",
                StorageEndpoint          = "StorageEndpoint",
                SqlDatabaseDnsSuffix     = "SqlDatabaseDnsSuffix",
                TrafficManagerDnsSuffix  = "TrafficManagerDnsSuffix"
            };

            cmdlet.InvokeBeginProcessing();
            cmdlet.ExecuteCmdlet();
            cmdlet.InvokeEndProcessing();
            Assert.Equal(cmdlet.Name, actual.Name);
            Assert.Equal(cmdlet.EnableAdfsAuthentication.ToBool(), actual.EnableAdfsAuthentication);
            Assert.Equal(cmdlet.ActiveDirectoryEndpoint, actual.ActiveDirectoryAuthority);
            Assert.Equal(cmdlet.ActiveDirectoryServiceEndpointResourceId,
                         actual.ActiveDirectoryServiceEndpointResourceId);
            Assert.Equal(cmdlet.AdTenant, actual.AdTenant);
            Assert.Equal(cmdlet.AzureKeyVaultDnsSuffix, actual.AzureKeyVaultDnsSuffix);
            Assert.Equal(cmdlet.AzureKeyVaultServiceEndpointResourceId, actual.AzureKeyVaultServiceEndpointResourceId);
            Assert.Equal(cmdlet.GalleryEndpoint, actual.GalleryUrl);
            Assert.Equal(cmdlet.GraphEndpoint, actual.GraphUrl);
            Assert.Equal(cmdlet.ManagementPortalUrl, actual.ManagementPortalUrl);
            Assert.Equal(cmdlet.PublishSettingsFileUrl, actual.PublishSettingsFileUrl);
            Assert.Equal(cmdlet.ResourceManagerEndpoint, actual.ResourceManagerUrl);
            Assert.Equal(cmdlet.ServiceEndpoint, actual.ServiceManagementUrl);
            Assert.Equal(cmdlet.StorageEndpoint, actual.StorageEndpointSuffix);
            Assert.Equal(cmdlet.SqlDatabaseDnsSuffix, actual.SqlDatabaseDnsSuffix);
            Assert.Equal(cmdlet.TrafficManagerDnsSuffix, actual.TrafficManagerDnsSuffix);
            commandRuntimeMock.Verify(f => f.WriteObject(It.IsAny <PSAzureEnvironment>()), Times.Once());
            ProfileClient    client = new ProfileClient(profile);
            AzureEnvironment env    = client.Profile.Environments["KaTaL"];

            Assert.Equal(env.Name, cmdlet.Name);
        }
        public void ThrowsForInvalidUrl()
        {
            var commandRuntimeMock    = new Mock <ICommandRuntime>();
            PSAzureEnvironment actual = null;

            commandRuntimeMock.Setup(f => f.WriteObject(It.IsAny <PSAzureEnvironment>()))
            .Callback((object output) => actual = (PSAzureEnvironment)output);

            var cmdlet = new AddAzureRMEnvironmentCommand()
            {
                CommandRuntime = commandRuntimeMock.Object,
                Name           = "katal",
                ARMEndpoint    = "foobar.com"
            };

            SetupConfirmation(commandRuntimeMock);
            cmdlet.SetParameterSet("ARMEndpoint");

            Assert.Throws <ArgumentException>(() => cmdlet.ExecuteCmdlet());
        }
Exemplo n.º 10
0
        public void CanConvertValidPSEnvironments(string name, bool onPremise, string activeDirectory, string serviceResource,
                                                  string adTenant, string dataLakeJobs, string dataLakeFiles, string kvDnsSuffix,
                                                  string kvResource, string gallery, string graph, string graphResource, string portal,
                                                  string publishSettings, string resourceManager, string serviceManagement,
                                                  string sqlSuffix, string storageSuffix, string trafficManagerSuffix)
        {
            PSAzureEnvironment environment = new PSAzureEnvironment
            {
                Name = name,
                EnableAdfsAuthentication = onPremise,
                ActiveDirectoryAuthority = activeDirectory,
                ActiveDirectoryServiceEndpointResourceId = serviceResource,
                AdTenant = adTenant,
                AzureDataLakeAnalyticsCatalogAndJobEndpointSuffix = dataLakeJobs,
                AzureDataLakeStoreFileSystemEndpointSuffix        = dataLakeFiles,
                AzureKeyVaultDnsSuffix = kvDnsSuffix,
                AzureKeyVaultServiceEndpointResourceId = kvResource,
                GalleryUrl = gallery,
                GraphUrl   = graph,
                GraphEndpointResourceId = graphResource,
                ManagementPortalUrl     = portal,
                PublishSettingsFileUrl  = publishSettings,
                ResourceManagerUrl      = resourceManager,
                ServiceManagementUrl    = serviceManagement,
                SqlDatabaseDnsSuffix    = sqlSuffix,
                StorageEndpointSuffix   = storageSuffix,
                TrafficManagerDnsSuffix = trafficManagerSuffix
            };
            var azEnvironment = (AzureEnvironment)environment;

            Assert.NotNull(environment);
            CheckEndpoint(AzureEnvironment.Endpoint.ActiveDirectory, azEnvironment,
                          environment.ActiveDirectoryAuthority);
            CheckEndpoint(AzureEnvironment.Endpoint.ActiveDirectoryServiceEndpointResourceId,
                          azEnvironment, environment.ActiveDirectoryServiceEndpointResourceId);
            CheckEndpoint(AzureEnvironment.Endpoint.AdTenant, azEnvironment,
                          environment.AdTenant);
            CheckEndpoint(AzureEnvironment.Endpoint.AzureDataLakeAnalyticsCatalogAndJobEndpointSuffix, azEnvironment,
                          environment.AzureDataLakeAnalyticsCatalogAndJobEndpointSuffix);
            CheckEndpoint(AzureEnvironment.Endpoint.AzureDataLakeStoreFileSystemEndpointSuffix, azEnvironment,
                          environment.AzureDataLakeStoreFileSystemEndpointSuffix);
            CheckEndpoint(AzureEnvironment.Endpoint.AzureKeyVaultDnsSuffix, azEnvironment,
                          environment.AzureKeyVaultDnsSuffix);
            CheckEndpoint(AzureEnvironment.Endpoint.AzureKeyVaultServiceEndpointResourceId, azEnvironment,
                          environment.AzureKeyVaultServiceEndpointResourceId);
            CheckEndpoint(AzureEnvironment.Endpoint.Gallery, azEnvironment,
                          environment.GalleryUrl);
            CheckEndpoint(AzureEnvironment.Endpoint.Graph, azEnvironment,
                          environment.GraphUrl);
            CheckEndpoint(AzureEnvironment.Endpoint.GraphEndpointResourceId, azEnvironment,
                          environment.GraphEndpointResourceId);
            CheckEndpoint(AzureEnvironment.Endpoint.ManagementPortalUrl, azEnvironment,
                          environment.ManagementPortalUrl);
            CheckEndpoint(AzureEnvironment.Endpoint.PublishSettingsFileUrl, azEnvironment,
                          environment.PublishSettingsFileUrl);
            CheckEndpoint(AzureEnvironment.Endpoint.ResourceManager, azEnvironment,
                          environment.ResourceManagerUrl);
            CheckEndpoint(AzureEnvironment.Endpoint.ServiceManagement, azEnvironment,
                          environment.ServiceManagementUrl);
            CheckEndpoint(AzureEnvironment.Endpoint.SqlDatabaseDnsSuffix, azEnvironment,
                          environment.SqlDatabaseDnsSuffix);
            CheckEndpoint(AzureEnvironment.Endpoint.StorageEndpointSuffix, azEnvironment,
                          environment.StorageEndpointSuffix);
            CheckEndpoint(AzureEnvironment.Endpoint.TrafficManagerDnsSuffix, azEnvironment,
                          environment.TrafficManagerDnsSuffix);
            Assert.Equal(azEnvironment.Name, environment.Name);
            Assert.Equal(azEnvironment.OnPremise, environment.EnableAdfsAuthentication);
        }
Exemplo n.º 11
0
        public void CanCreateEnvironmentWithAllProperties()
        {
            Mock <ICommandRuntime> commandRuntimeMock = new Mock <ICommandRuntime>();

            SetupConfirmation(commandRuntimeMock);
            PSAzureEnvironment actual = null;

            commandRuntimeMock.Setup(f => f.WriteObject(It.IsAny <PSAzureEnvironment>()))
            .Callback((object output) => actual = (PSAzureEnvironment)output);
            var cmdlet = new AddAzureRMEnvironmentCommand()
            {
                CommandRuntime          = commandRuntimeMock.Object,
                Name                    = "Katal",
                ActiveDirectoryEndpoint = "https://ActiveDirectoryEndpoint",
                AdTenant                = "AdTenant",
                AzureKeyVaultDnsSuffix  = "AzureKeyVaultDnsSuffix",
                ActiveDirectoryServiceEndpointResourceId = "https://ActiveDirectoryServiceEndpointResourceId",
                AzureKeyVaultServiceEndpointResourceId   = "https://AzureKeyVaultServiceEndpointResourceId",
                EnableAdfsAuthentication = true,
                GalleryEndpoint          = "https://GalleryEndpoint",
                GraphEndpoint            = "https://GraphEndpoint",
                ManagementPortalUrl      = "https://ManagementPortalUrl",
                PublishSettingsFileUrl   = "https://PublishSettingsFileUrl",
                ResourceManagerEndpoint  = "https://ResourceManagerEndpoint",
                ServiceEndpoint          = "https://ServiceEndpoint",
                StorageEndpoint          = "https://StorageEndpoint",
                SqlDatabaseDnsSuffix     = "SqlDatabaseDnsSuffix",
                TrafficManagerDnsSuffix  = "TrafficManagerDnsSuffix",
                GraphAudience            = "GaraphAudience",
                BatchEndpointResourceId  = "BatchResourceId",
                DataLakeAudience         = "DataLakeAudience",
                AzureOperationalInsightsEndpointResourceId = "AzureOperationalInsightsEndpointResourceId",
                AzureOperationalInsightsEndpoint           = "https://AzureOperationalInsights",
                AzureAttestationServiceEndpointResourceId  = "AzureAttestationServiceEndpointResourceId",
                AzureAttestationServiceEndpointSuffix      = "https://AzureAttestationService",
                AzureSynapseAnalyticsEndpointResourceId    = "AzureSynapseAnalyticsEndpointResourceId",
                AzureSynapseAnalyticsEndpointSuffix        = "https://AzureSynapseAnalytics",
            };

            var dict = new Dictionary <string, object>();

            dict["ActiveDirectoryEndpoint"] = "https://ActiveDirectoryEndpoint";
            dict["AdTenant"] = "AdTenant";
            dict["AzureKeyVaultDnsSuffix"] = "AzureKeyVaultDnsSuffix";
            dict["ActiveDirectoryServiceEndpointResourceId"] = "https://ActiveDirectoryServiceEndpointResourceId";
            dict["AzureKeyVaultServiceEndpointResourceId"]   = "https://AzureKeyVaultServiceEndpointResourceId";
            dict["EnableAdfsAuthentication"] = true;
            dict["GalleryEndpoint"]          = "https://GalleryEndpoint";
            dict["GraphEndpoint"]            = "https://GraphEndpoint";
            dict["ManagementPortalUrl"]      = "https://ManagementPortalUrl";
            dict["PublishSettingsFileUrl"]   = "https://PublishSettingsFileUrl";
            dict["ResourceManagerEndpoint"]  = "https://ResourceManagerEndpoint";
            dict["ServiceEndpoint"]          = "https://ServiceEndpoint";
            dict["StorageEndpoint"]          = "https://StorageEndpoint";
            dict["SqlDatabaseDnsSuffix"]     = "SqlDatabaseDnsSuffix";
            dict["TrafficManagerDnsSuffix"]  = "TrafficManagerDnsSuffix";
            dict["GraphAudience"]            = "GaraphAudience";
            dict["BatchEndpointResourceId"]  = "BatchResourceId";
            dict["DataLakeAudience"]         = "DataLakeAudience";
            dict["AzureOperationalInsightsEndpointResourceId"] = "AzureOperationalInsightsEndpointResourceId";
            dict["AzureOperationalInsightsEndpoint"]           = "https://AzureOperationalInsights";
            dict["AzureAttestationServiceEndpointResourceId"]  = "AzureAttestationServiceEndpointResourceId";
            dict["AzureAttestationServiceEndpointSuffix"]      = "https://AzureAttestationService";
            dict["AzureSynapseAnalyticsEndpointResourceId"]    = "AzureSynapseAnalyticsEndpointResourceId";
            dict["AzureSynapseAnalyticsEndpointSuffix"]        = "https://AzureSynapseAnalytics";
            cmdlet.SetBoundParameters(dict);
            cmdlet.SetParameterSet("Name");

            cmdlet.InvokeBeginProcessing();
            cmdlet.ExecuteCmdlet();
            cmdlet.InvokeEndProcessing();
            Assert.Equal(cmdlet.Name, actual.Name);
            Assert.Equal(cmdlet.EnableAdfsAuthentication.ToBool(), actual.EnableAdfsAuthentication);
            Assert.Equal(cmdlet.ActiveDirectoryEndpoint + "/", actual.ActiveDirectoryAuthority, StringComparer.OrdinalIgnoreCase);
            Assert.Equal(cmdlet.ActiveDirectoryServiceEndpointResourceId,
                         actual.ActiveDirectoryServiceEndpointResourceId);
            Assert.Equal(cmdlet.AdTenant, actual.AdTenant);
            Assert.Equal(cmdlet.AzureKeyVaultDnsSuffix, actual.AzureKeyVaultDnsSuffix);
            Assert.Equal(cmdlet.AzureKeyVaultServiceEndpointResourceId, actual.AzureKeyVaultServiceEndpointResourceId);
            Assert.Equal(cmdlet.GalleryEndpoint, actual.GalleryUrl);
            Assert.Equal(cmdlet.GraphEndpoint, actual.GraphUrl);
            Assert.Equal(cmdlet.ManagementPortalUrl, actual.ManagementPortalUrl);
            Assert.Equal(cmdlet.PublishSettingsFileUrl, actual.PublishSettingsFileUrl);
            Assert.Equal(cmdlet.ResourceManagerEndpoint, actual.ResourceManagerUrl);
            Assert.Equal(cmdlet.ServiceEndpoint, actual.ServiceManagementUrl);
            Assert.Equal(cmdlet.StorageEndpoint, actual.StorageEndpointSuffix);
            Assert.Equal(cmdlet.SqlDatabaseDnsSuffix, actual.SqlDatabaseDnsSuffix);
            Assert.Equal(cmdlet.TrafficManagerDnsSuffix, actual.TrafficManagerDnsSuffix);
            Assert.Equal(cmdlet.GraphAudience, actual.GraphEndpointResourceId);
            Assert.Equal(cmdlet.BatchEndpointResourceId, actual.BatchEndpointResourceId);
            Assert.Equal(cmdlet.DataLakeAudience, actual.DataLakeEndpointResourceId);
            Assert.Equal(cmdlet.AzureOperationalInsightsEndpointResourceId, actual.AzureOperationalInsightsEndpointResourceId);
            Assert.Equal(cmdlet.AzureOperationalInsightsEndpoint, actual.AzureOperationalInsightsEndpoint);
            Assert.Equal(cmdlet.AzureAttestationServiceEndpointResourceId, actual.AzureAttestationServiceEndpointResourceId);
            Assert.Equal(cmdlet.AzureAttestationServiceEndpointSuffix, actual.AzureAttestationServiceEndpointSuffix);
            Assert.Equal(cmdlet.AzureSynapseAnalyticsEndpointResourceId, actual.AzureSynapseAnalyticsEndpointResourceId);
            Assert.Equal(cmdlet.AzureSynapseAnalyticsEndpointSuffix, actual.AzureSynapseAnalyticsEndpointSuffix);
            commandRuntimeMock.Verify(f => f.WriteObject(It.IsAny <PSAzureEnvironment>()), Times.Once());
            IAzureEnvironment env = AzureRmProfileProvider.Instance.Profile.GetEnvironment("KaTaL");

            Assert.Equal(env.Name, cmdlet.Name);
        }