public void AddsAzureEnvironment()
{
Mock<ICommandRuntime> commandRuntimeMock = new Mock<ICommandRuntime>();
var cmdlet = new AddAzureRMEnvironmentCommand()
{
CommandRuntime = commandRuntimeMock.Object,
Name = "Katal",
PublishSettingsFileUrl = "http://microsoft.com",
ServiceEndpoint = "endpoint.net",
ManagementPortalUrl = "management portal url",
StorageEndpoint = "endpoint.net",
GalleryEndpoint = "http://galleryendpoint.com",
};
cmdlet.InvokeBeginProcessing();
cmdlet.ExecuteCmdlet();
cmdlet.InvokeEndProcessing();
commandRuntimeMock.Verify(f => f.WriteObject(It.IsAny<PSAzureEnvironment>()), Times.Once());
var profileClient = new RMProfileClient(AzureRmProfileProvider.Instance.Profile);
AzureEnvironment env = AzureRmProfileProvider.Instance.Profile.Environments["KaTaL"];
Assert.Equal(env.Name, cmdlet.Name);
Assert.Equal(env.Endpoints[AzureEnvironment.Endpoint.PublishSettingsFileUrl], cmdlet.PublishSettingsFileUrl);
Assert.Equal(env.Endpoints[AzureEnvironment.Endpoint.ServiceManagement], cmdlet.ServiceEndpoint);
Assert.Equal(env.Endpoints[AzureEnvironment.Endpoint.ManagementPortalUrl], cmdlet.ManagementPortalUrl);
Assert.Equal(env.Endpoints[AzureEnvironment.Endpoint.Gallery], "http://galleryendpoint.com");
}