예제 #1
0
        public void DisableAzureWebsiteDiagnosticApplicationTableLog()
        {
            // Setup
            websitesClientMock.Setup(f => f.DisableApplicationDiagnostic(
                                         websiteName,
                                         WebsiteDiagnosticOutput.StorageTable));

            disableAzureWebsiteDiagnosticCommand = new DisableAzureWebsiteDiagnosticCommand()
            {
                ShareChannel        = true,
                CommandRuntime      = commandRuntimeMock.Object,
                Name                = websiteName,
                CurrentSubscription = new SubscriptionData {
                    SubscriptionId = base.subscriptionId
                },
                WebsitesClient = websitesClientMock.Object,
                Type           = WebsiteDiagnosticType.Application,
                Output         = WebsiteDiagnosticOutput.StorageTable
            };

            // Test
            disableAzureWebsiteDiagnosticCommand.ExecuteCmdlet();

            // Assert
            websitesClientMock.Verify(f => f.DisableApplicationDiagnostic(
                                          websiteName,
                                          WebsiteDiagnosticOutput.StorageTable), Times.Once());

            commandRuntimeMock.Verify(f => f.WriteObject(true), Times.Never());
        }
예제 #2
0
        public void DisableAzureWebsiteDiagnosticSiteIgnoreSetting()
        {
            // Setup
            websitesClientMock.Setup(f => f.DisableSiteDiagnostic(
                                         websiteName,
                                         true,
                                         false,
                                         true));

            disableAzureWebsiteDiagnosticCommand = new DisableAzureWebsiteDiagnosticCommand()
            {
                ShareChannel        = true,
                CommandRuntime      = commandRuntimeMock.Object,
                Name                = websiteName,
                CurrentSubscription = new SubscriptionData {
                    SubscriptionId = base.subscriptionId
                },
                WebsitesClient       = websitesClientMock.Object,
                WebServerLogging     = true,
                FailedRequestTracing = true,
                Type = WebsiteDiagnosticType.Site
            };

            // Test
            disableAzureWebsiteDiagnosticCommand.ExecuteCmdlet();

            // Assert
            websitesClientMock.Verify(f => f.DisableSiteDiagnostic(
                                          websiteName,
                                          true,
                                          false,
                                          true), Times.Once());

            commandRuntimeMock.Verify(f => f.WriteObject(true), Times.Never());
        }