public GetAzureRmLogCommandTests() { insightsEventOperationsMock = new Mock<IEventOperations>(); insightsClientMock = new Mock<InsightsClient>(); commandRuntimeMock = new Mock<ICommandRuntime>(); cmdlet = new GetAzureRmLogCommand() { CommandRuntime = commandRuntimeMock.Object, InsightsClient = insightsClientMock.Object }; response = Utilities.InitializeResponse(); insightsEventOperationsMock.Setup(f => f.ListEventsAsync(It.IsAny<string>(), It.IsAny<string>(), It.IsAny<CancellationToken>())) .Returns(Task.FromResult<EventDataListResponse>(response)) .Callback((string f, string s, CancellationToken t) => { filter = f; selected = s; }); insightsClientMock.SetupGet(f => f.EventOperations).Returns(this.insightsEventOperationsMock.Object); }
public GetAzureRmLogTests(Xunit.Abstractions.ITestOutputHelper output) { //ServiceManagemenet.Common.Models.XunitTracingInterceptor.AddToContext(new ServiceManagemenet.Common.Models.XunitTracingInterceptor(output)); insightsEventOperationsMock = new Mock<IEventsOperations>(); insightsClientMock = new Mock<InsightsClient>(); commandRuntimeMock = new Mock<ICommandRuntime>(); cmdlet = new GetAzureRmLogCommand() { CommandRuntime = commandRuntimeMock.Object, InsightsClient = insightsClientMock.Object }; response = Utilities.InitializeResponse(); insightsEventOperationsMock.Setup(f => f.ListWithHttpMessagesAsync(It.IsAny<ODataQuery<EventData>>(), It.IsAny<string>(), It.IsAny<Dictionary<string, List<string>>>(), It.IsAny<CancellationToken>())) .Returns(Task.FromResult<AzureOperationResponse<IPage<EventData>>>(response)) .Callback((ODataQuery<EventData> f, string s, Dictionary<string, List<string>> headers, CancellationToken t) => { filter = f; selected = s; }); insightsClientMock.SetupGet(f => f.Events).Returns(this.insightsEventOperationsMock.Object); }