public async stt::Task ListFindingTypeStatsRequestObjectAsync() { moq::Mock <WebSecurityScanner.WebSecurityScannerClient> mockGrpcClient = new moq::Mock <WebSecurityScanner.WebSecurityScannerClient>(moq::MockBehavior.Strict); ListFindingTypeStatsRequest request = new ListFindingTypeStatsRequest { Parent = "parent7858e4d0", }; ListFindingTypeStatsResponse expectedResponse = new ListFindingTypeStatsResponse { FindingTypeStats = { new FindingTypeStats(), }, }; mockGrpcClient.Setup(x => x.ListFindingTypeStatsAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <ListFindingTypeStatsResponse>(stt::Task.FromResult(expectedResponse), null, null, null, null)); WebSecurityScannerClient client = new WebSecurityScannerClientImpl(mockGrpcClient.Object, null); ListFindingTypeStatsResponse responseCallSettings = await client.ListFindingTypeStatsAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); ListFindingTypeStatsResponse responseCancellationToken = await client.ListFindingTypeStatsAsync(request, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); }
/// <summary>Snippet for ListFindingTypeStats</summary> public void ListFindingTypeStatsRequestObject() { // Snippet: ListFindingTypeStats(ListFindingTypeStatsRequest, CallSettings) // Create client WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.Create(); // Initialize request argument(s) ListFindingTypeStatsRequest request = new ListFindingTypeStatsRequest { Parent = "", }; // Make the request ListFindingTypeStatsResponse response = webSecurityScannerClient.ListFindingTypeStats(request); // End snippet }
/// <summary>Snippet for ListFindingTypeStatsAsync</summary> public async Task ListFindingTypeStatsRequestObjectAsync() { // Snippet: ListFindingTypeStatsAsync(ListFindingTypeStatsRequest, CallSettings) // Additional: ListFindingTypeStatsAsync(ListFindingTypeStatsRequest, CancellationToken) // Create client WebSecurityScannerClient webSecurityScannerClient = await WebSecurityScannerClient.CreateAsync(); // Initialize request argument(s) ListFindingTypeStatsRequest request = new ListFindingTypeStatsRequest { Parent = "", }; // Make the request ListFindingTypeStatsResponse response = await webSecurityScannerClient.ListFindingTypeStatsAsync(request); // End snippet }
public void ListFindingTypeStatsRequestObject() { moq::Mock <WebSecurityScanner.WebSecurityScannerClient> mockGrpcClient = new moq::Mock <WebSecurityScanner.WebSecurityScannerClient>(moq::MockBehavior.Strict); ListFindingTypeStatsRequest request = new ListFindingTypeStatsRequest { Parent = "parent7858e4d0", }; ListFindingTypeStatsResponse expectedResponse = new ListFindingTypeStatsResponse { FindingTypeStats = { new FindingTypeStats(), }, }; mockGrpcClient.Setup(x => x.ListFindingTypeStats(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse); WebSecurityScannerClient client = new WebSecurityScannerClientImpl(mockGrpcClient.Object, null); ListFindingTypeStatsResponse response = client.ListFindingTypeStats(request); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); }