public void BatchRunReportsRequestObject() { moq::Mock <AlphaAnalyticsData.AlphaAnalyticsDataClient> mockGrpcClient = new moq::Mock <AlphaAnalyticsData.AlphaAnalyticsDataClient>(moq::MockBehavior.Strict); BatchRunReportsRequest request = new BatchRunReportsRequest { Entity = new Entity(), Requests = { new RunReportRequest(), }, }; BatchRunReportsResponse expectedResponse = new BatchRunReportsResponse { Reports = { new RunReportResponse(), }, }; mockGrpcClient.Setup(x => x.BatchRunReports(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse); AlphaAnalyticsDataClient client = new AlphaAnalyticsDataClientImpl(mockGrpcClient.Object, null); BatchRunReportsResponse response = client.BatchRunReports(request); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); }
public void BatchRunReports() { Mock <AlphaAnalyticsData.AlphaAnalyticsDataClient> mockGrpcClient = new Mock <AlphaAnalyticsData.AlphaAnalyticsDataClient>(MockBehavior.Strict); BatchRunReportsRequest request = new BatchRunReportsRequest(); BatchRunReportsResponse expectedResponse = new BatchRunReportsResponse(); mockGrpcClient.Setup(x => x.BatchRunReports(request, It.IsAny <CallOptions>())) .Returns(expectedResponse); AlphaAnalyticsDataClient client = new AlphaAnalyticsDataClientImpl(mockGrpcClient.Object, null); BatchRunReportsResponse response = client.BatchRunReports(request); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); }