public AddAzureRmLogProfileTests(ITestOutputHelper output) { ServiceManagemenet.Common.Models.XunitTracingInterceptor.AddToContext(new ServiceManagemenet.Common.Models.XunitTracingInterceptor(output)); TestExecutionHelpers.SetUpSessionAndProfile(); insightsLogProfileOperationsMock = new Mock <ILogProfilesOperations>(); insightsManagementClientMock = new Mock <MonitorManagementClient>(); commandRuntimeMock = new Mock <ICommandRuntime>(); cmdlet = new AddAzureRmLogProfileCommand() { CommandRuntime = commandRuntimeMock.Object, MonitorManagementClient = insightsManagementClientMock.Object }; response = Utilities.InitializeLogProfileResponse(); insightsLogProfileOperationsMock.Setup(f => f.CreateOrUpdateWithHttpMessagesAsync(It.IsAny <string>(), It.IsAny <LogProfileResource>(), It.IsAny <Dictionary <string, List <string> > >(), It.IsAny <CancellationToken>())) .Returns(Task.FromResult <Rest.Azure.AzureOperationResponse <LogProfileResource> >(response)) .Callback((string logProfileName, LogProfileResource createOrUpdateParams, Dictionary <string, List <string> > headers, CancellationToken t) => { this.logProfileName = logProfileName; createOrUpdatePrms = createOrUpdateParams; }); insightsManagementClientMock.SetupGet(f => f.LogProfiles).Returns(this.insightsLogProfileOperationsMock.Object); // Setup Confirmation commandRuntimeMock.Setup(f => f.ShouldProcess(It.IsAny <string>())).Returns(true); commandRuntimeMock.Setup(f => f.ShouldProcess(It.IsAny <string>(), It.IsAny <string>())).Returns(true); commandRuntimeMock.Setup(f => f.ShouldProcess(It.IsAny <string>(), It.IsAny <string>(), It.IsAny <string>())).Returns(true); commandRuntimeMock.Setup(f => f.ShouldContinue(It.IsAny <string>(), It.IsAny <string>())).Returns(true); }
public AddAzureRmLogProfileTests(ITestOutputHelper output) { // XunitTracingInterceptor.AddToContext(new XunitTracingInterceptor(output)); insightsLogProfileOperationsMock = new Mock <ILogProfilesOperations>(); insightsManagementClientMock = new Mock <InsightsManagementClient>(); commandRuntimeMock = new Mock <ICommandRuntime>(); cmdlet = new AddAzureRmLogProfileCommand() { CommandRuntime = commandRuntimeMock.Object, InsightsManagementClient = insightsManagementClientMock.Object }; response = Utilities.InitializeLogProfileResponse(); insightsLogProfileOperationsMock.Setup(f => f.CreateOrUpdateWithHttpMessagesAsync(It.IsAny <string>(), It.IsAny <LogProfileCreateOrUpdateParameters>(), It.IsAny <Dictionary <string, List <string> > >(), It.IsAny <CancellationToken>())) .Returns(Task.FromResult <Rest.Azure.AzureOperationResponse <LogProfileResource> >(response)) .Callback((string logProfileName, LogProfileCreateOrUpdateParameters createOrUpdateParams, Dictionary <string, List <string> > headers, CancellationToken t) => { this.logProfileName = logProfileName; createOrUpdatePrms = createOrUpdateParams; }); insightsManagementClientMock.SetupGet(f => f.LogProfiles).Returns(this.insightsLogProfileOperationsMock.Object); }