public void ProcessShowWebsiteTest() { // Setup var mockClient = new Mock<IWebsitesClient>(); mockClient.Setup(c => c.GetWebsite("website1", null)) .Returns(new Site { Name = "website1", WebSpace = "webspace1", HostNames = new[] {"website1.cloudapp.com"} }); // Test ShowAzureWebsiteCommand showAzureWebsiteCommand = new ShowAzureWebsiteCommand { CommandRuntime = new MockCommandRuntime(), Name = "website1", WebsitesClient = mockClient.Object }; currentProfile = new AzureSMProfile(); var subscription = new AzureSubscription{Id = new Guid(base.subscriptionId) }; subscription.Properties[AzureSubscription.Property.Default] = "True"; currentProfile.Subscriptions[new Guid(base.subscriptionId)] = subscription; // Show existing website showAzureWebsiteCommand.ExecuteCmdlet(); }
public void ProcessShowWebsiteTest() { // Setup var mockClient = new Mock<IWebsitesClient>(); mockClient.Setup(c => c.GetWebsite("website1", null)) .Returns(new Site { Name = "website1", WebSpace = "webspace1", HostNames = new[] {"website1.cloudapp.com"} }); // Test ShowAzureWebsiteCommand showAzureWebsiteCommand = new ShowAzureWebsiteCommand { CommandRuntime = new MockCommandRuntime(), Name = "website1", WebsitesClient = mockClient.Object }; AzureSession.SetCurrentContext(new AzureSubscription { Id = new Guid(base.subscriptionId) }, null, null); // Show existing website showAzureWebsiteCommand.ExecuteCmdlet(); }