public GetDiagnosticSettingCommandTests(Xunit.Abstractions.ITestOutputHelper output)
        {
            ServiceManagemenet.Common.Models.XunitTracingInterceptor.AddToContext(new ServiceManagemenet.Common.Models.XunitTracingInterceptor(output));
            insightsDiagnosticsOperationsMock = new Mock<IServiceDiagnosticSettingsOperations>();
            insightsManagementClientMock = new Mock<InsightsManagementClient>();
            commandRuntimeMock = new Mock<ICommandRuntime>();
            cmdlet = new GetAzureRmDiagnosticSettingCommand()
            {
                CommandRuntime = commandRuntimeMock.Object,
                InsightsManagementClient = insightsManagementClientMock.Object
            };

            response = new ServiceDiagnosticSettingsGetResponse
            {
                RequestId = Guid.NewGuid().ToString(),
                StatusCode = HttpStatusCode.OK,
                Properties = new ServiceDiagnosticSettings
                {
                    StorageAccountId = "/subscriptions/123/resourcegroups/rg/providers/microsoft.storage/accounts/myaccount",
                    Logs = new List<LogSettings>
                    {
                        new LogSettings
                        {
                            Category = "TestCategory1",
                            Enabled = true
                        },
                        new LogSettings
                        {
                            Category = "TestCategory2",
                            Enabled = false
                        }
                    },
                    Metrics = new List<MetricSettings>
                    {
                        new MetricSettings
                        {
                            TimeGrain = TimeSpan.FromMinutes(1),
                            Enabled = false
                        },
                        new MetricSettings
                        {
                            TimeGrain = TimeSpan.FromHours(1)
                        }
                    }
                }
            };

            insightsDiagnosticsOperationsMock.Setup(f => f.GetAsync(It.IsAny<string>(), It.IsAny<CancellationToken>()))
                .Returns(Task.FromResult<ServiceDiagnosticSettingsGetResponse>(response))
                .Callback((string resourceId, CancellationToken cancellationToken) =>
                {
                    this.calledResourceId = resourceId;
                });

            insightsManagementClientMock.SetupGet(f => f.ServiceDiagnosticSettingsOperations).Returns(this.insightsDiagnosticsOperationsMock.Object);
        }
        public SetDiagnosticSettingCommandTests()
        {
            insightsDiagnosticsOperationsMock = new Mock<IServiceDiagnosticSettingsOperations>();
            insightsManagementClientMock = new Mock<InsightsManagementClient>();
            commandRuntimeMock = new Mock<ICommandRuntime>();
            cmdlet = new SetAzureRmDiagnosticSettingCommand()
            {
                CommandRuntime = commandRuntimeMock.Object,
                InsightsManagementClient = insightsManagementClientMock.Object
            };

            response = new ServiceDiagnosticSettingsGetResponse
            {
                RequestId = Guid.NewGuid().ToString(),
                StatusCode = HttpStatusCode.OK,
                Properties = new ServiceDiagnosticSettings
                {
                    StorageAccountId = storageAccountId,
                    Logs = new List<LogSettings>
                    {
                        new LogSettings
                        {
                            Category = "TestCategory1",
                            Enabled = true
                        },
                        new LogSettings
                        {
                            Category = "TestCategory2",
                            Enabled = false
                        }
                    },
                    Metrics = new List<MetricSettings>
                    {
                        new MetricSettings
                        {
                            TimeGrain = TimeSpan.FromMinutes(1),
                            Enabled = false
                        },
                        new MetricSettings
                        {
                            TimeGrain = TimeSpan.FromHours(1),
                            Enabled = true
                        }
                    }
                }
            };

            insightsDiagnosticsOperationsMock.Setup(f => f.GetAsync(It.IsAny<string>()))
                .Returns(Task.FromResult<ServiceDiagnosticSettingsGetResponse>(response))
                .Callback((string resourceId) =>
                {
                    this.calledResourceId = resourceId;
                });

            insightsDiagnosticsOperationsMock.Setup(f => f.PutAsync(It.IsAny<string>(), It.IsAny<ServiceDiagnosticSettingsPutParameters>()))
                .Returns(Task.FromResult<EmptyResponse>(new EmptyResponse()))
                .Callback((string resourceId, ServiceDiagnosticSettingsPutParameters putParameters) =>
                {
                    this.calledResourceId = resourceId;
                    this.calledPutParameters = putParameters;
                });

            insightsManagementClientMock.SetupGet(f => f.ServiceDiagnosticSettingsOperations).Returns(this.insightsDiagnosticsOperationsMock.Object);
        }