public void AggregatedList() { moq::Mock <RegionCommitments.RegionCommitmentsClient> mockGrpcClient = new moq::Mock <RegionCommitments.RegionCommitmentsClient>(moq::MockBehavior.Strict); AggregatedListRegionCommitmentsRequest request = new AggregatedListRegionCommitmentsRequest { Project = "projectaa6ff846", }; CommitmentAggregatedList expectedResponse = new CommitmentAggregatedList { Id = "id74b70bb8", Kind = "kindf7aa39d9", Warning = new Warning(), NextPageToken = "next_page_tokendbee0940", Items = { { "key8a0b6e3c", new CommitmentsScopedList() }, }, Unreachables = { "unreachables3ca950ee", }, SelfLink = "self_link7e87f12d", }; mockGrpcClient.Setup(x => x.AggregatedList(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse); RegionCommitmentsClient client = new RegionCommitmentsClientImpl(mockGrpcClient.Object, null); CommitmentAggregatedList response = client.AggregatedList(request.Project); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); }
/// <summary>Snippet for AggregatedList</summary> public void AggregatedList() { // Snippet: AggregatedList(string, CallSettings) // Create client RegionCommitmentsClient regionCommitmentsClient = RegionCommitmentsClient.Create(); // Initialize request argument(s) string project = ""; // Make the request CommitmentAggregatedList response = regionCommitmentsClient.AggregatedList(project); // End snippet }
/// <summary>Snippet for AggregatedListAsync</summary> public async Task AggregatedListAsync() { // Snippet: AggregatedListAsync(string, CallSettings) // Additional: AggregatedListAsync(string, CancellationToken) // Create client RegionCommitmentsClient regionCommitmentsClient = await RegionCommitmentsClient.CreateAsync(); // Initialize request argument(s) string project = ""; // Make the request CommitmentAggregatedList response = await regionCommitmentsClient.AggregatedListAsync(project); // End snippet }
public async stt::Task AggregatedListRequestObjectAsync() { moq::Mock <RegionCommitments.RegionCommitmentsClient> mockGrpcClient = new moq::Mock <RegionCommitments.RegionCommitmentsClient>(moq::MockBehavior.Strict); AggregatedListRegionCommitmentsRequest request = new AggregatedListRegionCommitmentsRequest { PageToken = "page_tokenf09e5538", MaxResults = 2806814450U, OrderBy = "order_byb4d33ada", Project = "projectaa6ff846", Filter = "filtere47ac9b2", IncludeAllScopes = false, ReturnPartialSuccess = false, }; CommitmentAggregatedList expectedResponse = new CommitmentAggregatedList { Id = "id74b70bb8", Kind = "kindf7aa39d9", Warning = new Warning(), NextPageToken = "next_page_tokendbee0940", Items = { { "key8a0b6e3c", new CommitmentsScopedList() }, }, Unreachables = { "unreachables3ca950ee", }, SelfLink = "self_link7e87f12d", }; mockGrpcClient.Setup(x => x.AggregatedListAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <CommitmentAggregatedList>(stt::Task.FromResult(expectedResponse), null, null, null, null)); RegionCommitmentsClient client = new RegionCommitmentsClientImpl(mockGrpcClient.Object, null); CommitmentAggregatedList responseCallSettings = await client.AggregatedListAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); CommitmentAggregatedList responseCancellationToken = await client.AggregatedListAsync(request, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); }
/// <summary>Snippet for AggregatedList</summary> public void AggregatedListRequestObject() { // Snippet: AggregatedList(AggregatedListRegionCommitmentsRequest, CallSettings) // Create client RegionCommitmentsClient regionCommitmentsClient = RegionCommitmentsClient.Create(); // Initialize request argument(s) AggregatedListRegionCommitmentsRequest request = new AggregatedListRegionCommitmentsRequest { PageToken = "", MaxResults = 0U, Filter = "", IncludeAllScopes = false, OrderBy = "", Project = "", ReturnPartialSuccess = false, }; // Make the request CommitmentAggregatedList response = regionCommitmentsClient.AggregatedList(request); // End snippet }
/// <summary>Snippet for AggregatedListAsync</summary> public async Task AggregatedListRequestObjectAsync() { // Snippet: AggregatedListAsync(AggregatedListRegionCommitmentsRequest, CallSettings) // Additional: AggregatedListAsync(AggregatedListRegionCommitmentsRequest, CancellationToken) // Create client RegionCommitmentsClient regionCommitmentsClient = await RegionCommitmentsClient.CreateAsync(); // Initialize request argument(s) AggregatedListRegionCommitmentsRequest request = new AggregatedListRegionCommitmentsRequest { PageToken = "", MaxResults = 0U, Filter = "", IncludeAllScopes = false, OrderBy = "", Project = "", ReturnPartialSuccess = false, }; // Make the request CommitmentAggregatedList response = await regionCommitmentsClient.AggregatedListAsync(request); // End snippet }