public void SelectAzureProfileNull() { SelectAzureRMProfileCommand cmdlt = new SelectAzureRMProfileCommand(); // Setup cmdlt.CommandRuntime = commandRuntimeMock; // Act cmdlt.InvokeBeginProcessing(); Assert.Throws<ArgumentException>(() => cmdlt.ExecuteCmdlet()); cmdlt.InvokeEndProcessing(); }
public void SelectAzureProfileInMemory() { var profile = new AzureRMProfile(); profile.Environments.Add("foo", AzureEnvironment.PublicEnvironments.Values.FirstOrDefault()); SelectAzureRMProfileCommand cmdlt = new SelectAzureRMProfileCommand(); // Setup cmdlt.Profile = profile; cmdlt.CommandRuntime = commandRuntimeMock; // Act cmdlt.InvokeBeginProcessing(); cmdlt.ExecuteCmdlet(); cmdlt.InvokeEndProcessing(); // Verify Assert.True(AzureRmProfileProvider.Instance.Profile.Environments.ContainsKey("foo")); }