public void MutateFeedItems() { moq::Mock <FeedItemService.FeedItemServiceClient> mockGrpcClient = new moq::Mock <FeedItemService.FeedItemServiceClient>(moq::MockBehavior.Strict); MutateFeedItemsRequest request = new MutateFeedItemsRequest { CustomerId = "customer_id3b3724cb", Operations = { new FeedItemOperation(), }, }; MutateFeedItemsResponse expectedResponse = new MutateFeedItemsResponse { Results = { new MutateFeedItemResult(), }, PartialFailureError = new gr::Status(), }; mockGrpcClient.Setup(x => x.MutateFeedItems(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse); FeedItemServiceClient client = new FeedItemServiceClientImpl(mockGrpcClient.Object, null); MutateFeedItemsResponse response = client.MutateFeedItems(request.CustomerId, request.Operations); Assert.AreEqual(expectedResponse, response); mockGrpcClient.VerifyAll(); }
public async stt::Task MutateFeedItemsAsync() { moq::Mock <FeedItemService.FeedItemServiceClient> mockGrpcClient = new moq::Mock <FeedItemService.FeedItemServiceClient>(moq::MockBehavior.Strict); MutateFeedItemsRequest request = new MutateFeedItemsRequest { CustomerId = "customer_id3b3724cb", Operations = { new FeedItemOperation(), }, }; MutateFeedItemsResponse expectedResponse = new MutateFeedItemsResponse { Results = { new MutateFeedItemResult(), }, PartialFailureError = new gr::Status(), }; mockGrpcClient.Setup(x => x.MutateFeedItemsAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <MutateFeedItemsResponse>(stt::Task.FromResult(expectedResponse), null, null, null, null)); FeedItemServiceClient client = new FeedItemServiceClientImpl(mockGrpcClient.Object, null); MutateFeedItemsResponse responseCallSettings = await client.MutateFeedItemsAsync(request.CustomerId, request.Operations, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); Assert.AreEqual(expectedResponse, responseCallSettings); MutateFeedItemsResponse responseCancellationToken = await client.MutateFeedItemsAsync(request.CustomerId, request.Operations, st::CancellationToken.None); Assert.AreEqual(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); }
public void MutateFeedItemsRequestObject() { moq::Mock <FeedItemService.FeedItemServiceClient> mockGrpcClient = new moq::Mock <FeedItemService.FeedItemServiceClient>(moq::MockBehavior.Strict); MutateFeedItemsRequest request = new MutateFeedItemsRequest { CustomerId = "customer_id3b3724cb", Operations = { new FeedItemOperation(), }, PartialFailure = false, ValidateOnly = true, ResponseContentType = gagve::ResponseContentTypeEnum.Types.ResponseContentType.ResourceNameOnly, }; MutateFeedItemsResponse expectedResponse = new MutateFeedItemsResponse { Results = { new MutateFeedItemResult(), }, PartialFailureError = new gr::Status(), }; mockGrpcClient.Setup(x => x.MutateFeedItems(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse); FeedItemServiceClient client = new FeedItemServiceClientImpl(mockGrpcClient.Object, null); MutateFeedItemsResponse response = client.MutateFeedItems(request); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); }
public void MutateFeedItems3() { Mock <FeedItemService.FeedItemServiceClient> mockGrpcClient = new Mock <FeedItemService.FeedItemServiceClient>(MockBehavior.Strict); MutateFeedItemsRequest request = new MutateFeedItemsRequest { CustomerId = "customerId-1772061412", Operations = { }, }; MutateFeedItemsResponse expectedResponse = new MutateFeedItemsResponse(); mockGrpcClient.Setup(x => x.MutateFeedItems(request, It.IsAny <CallOptions>())) .Returns(expectedResponse); FeedItemServiceClient client = new FeedItemServiceClientImpl(mockGrpcClient.Object, null); MutateFeedItemsResponse response = client.MutateFeedItems(request); Assert.AreEqual(expectedResponse, response); mockGrpcClient.VerifyAll(); }
public async Task MutateFeedItemsAsync3() { Mock <FeedItemService.FeedItemServiceClient> mockGrpcClient = new Mock <FeedItemService.FeedItemServiceClient>(MockBehavior.Strict); MutateFeedItemsRequest request = new MutateFeedItemsRequest { CustomerId = "customerId-1772061412", Operations = { }, }; MutateFeedItemsResponse expectedResponse = new MutateFeedItemsResponse(); mockGrpcClient.Setup(x => x.MutateFeedItemsAsync(request, It.IsAny <CallOptions>())) .Returns(new Grpc.Core.AsyncUnaryCall <MutateFeedItemsResponse>(Task.FromResult(expectedResponse), null, null, null, null)); FeedItemServiceClient client = new FeedItemServiceClientImpl(mockGrpcClient.Object, null); MutateFeedItemsResponse response = await client.MutateFeedItemsAsync(request); Assert.AreEqual(expectedResponse, response); mockGrpcClient.VerifyAll(); }
/// <summary>Snippet for MutateFeedItems</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public void MutateFeedItemsRequestObject() { // Create client FeedItemServiceClient feedItemServiceClient = FeedItemServiceClient.Create(); // Initialize request argument(s) MutateFeedItemsRequest request = new MutateFeedItemsRequest { CustomerId = "", Operations = { new FeedItemOperation(), }, PartialFailure = false, ValidateOnly = false, }; // Make the request MutateFeedItemsResponse response = feedItemServiceClient.MutateFeedItems(request); }
/// <summary>Snippet for MutateFeedItemsAsync</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public async Task MutateFeedItemsRequestObjectAsync() { // Create client FeedItemServiceClient feedItemServiceClient = await FeedItemServiceClient.CreateAsync(); // Initialize request argument(s) MutateFeedItemsRequest request = new MutateFeedItemsRequest { CustomerId = "", Operations = { new FeedItemOperation(), }, PartialFailure = false, ValidateOnly = false, ResponseContentType = ResponseContentTypeEnum.Types.ResponseContentType.Unspecified, }; // Make the request MutateFeedItemsResponse response = await feedItemServiceClient.MutateFeedItemsAsync(request); }
/// <summary>Snippet for MutateFeedItems</summary> public void MutateFeedItemsRequestObject() { // Snippet: MutateFeedItems(MutateFeedItemsRequest, CallSettings) // Create client FeedItemServiceClient feedItemServiceClient = FeedItemServiceClient.Create(); // Initialize request argument(s) MutateFeedItemsRequest request = new MutateFeedItemsRequest { CustomerId = "", Operations = { new FeedItemOperation(), }, PartialFailure = false, ValidateOnly = false, ResponseContentType = ResponseContentTypeEnum.Types.ResponseContentType.Unspecified, }; // Make the request MutateFeedItemsResponse response = feedItemServiceClient.MutateFeedItems(request); // End snippet }
/// <summary>Snippet for MutateFeedItemsAsync</summary> public async Task MutateFeedItemsRequestObjectAsync() { // Snippet: MutateFeedItemsAsync(MutateFeedItemsRequest, CallSettings) // Additional: MutateFeedItemsAsync(MutateFeedItemsRequest, CancellationToken) // Create client FeedItemServiceClient feedItemServiceClient = await FeedItemServiceClient.CreateAsync(); // Initialize request argument(s) MutateFeedItemsRequest request = new MutateFeedItemsRequest { CustomerId = "", Operations = { new FeedItemOperation(), }, PartialFailure = false, ValidateOnly = false, }; // Make the request MutateFeedItemsResponse response = await feedItemServiceClient.MutateFeedItemsAsync(request); // End snippet }
public async Task MutateFeedItemsAsync() { Mock <FeedItemService.FeedItemServiceClient> mockGrpcClient = new Mock <FeedItemService.FeedItemServiceClient>(MockBehavior.Strict); MutateFeedItemsRequest expectedRequest = new MutateFeedItemsRequest { CustomerId = "customerId-1772061412", Operations = { }, PartialFailure = true, ValidateOnly = false, }; MutateFeedItemsResponse expectedResponse = new MutateFeedItemsResponse(); mockGrpcClient.Setup(x => x.MutateFeedItemsAsync(expectedRequest, It.IsAny <CallOptions>())) .Returns(new Grpc.Core.AsyncUnaryCall <MutateFeedItemsResponse>(Task.FromResult(expectedResponse), null, null, null, null)); FeedItemServiceClient client = new FeedItemServiceClientImpl(mockGrpcClient.Object, null); string customerId = "customerId-1772061412"; IEnumerable <FeedItemOperation> operations = new List <FeedItemOperation>(); bool partialFailure = true; bool validateOnly = false; MutateFeedItemsResponse response = await client.MutateFeedItemsAsync(customerId, operations, partialFailure, validateOnly); Assert.AreEqual(expectedResponse, response); mockGrpcClient.VerifyAll(); }
/// <summary> /// Creates, updates, or removes feed items. Operation statuses are /// returned. /// </summary> /// <param name="request">The request object containing all of the parameters for the API call.</param> /// <param name="callSettings">If not null, applies overrides to this RPC call.</param> /// <returns>A Task containing the RPC response.</returns> public override stt::Task <MutateFeedItemsResponse> MutateFeedItemsAsync(MutateFeedItemsRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_MutateFeedItemsRequest(ref request, ref callSettings); return(_callMutateFeedItems.Async(request, callSettings)); }
partial void Modify_MutateFeedItemsRequest(ref MutateFeedItemsRequest request, ref gaxgrpc::CallSettings settings);
/// <summary> /// Creates, updates, or removes feed items. Operation statuses are /// returned. /// </summary> /// <param name="request">The request object containing all of the parameters for the API call.</param> /// <param name="cancellationToken">A <see cref="st::CancellationToken"/> to use for this RPC.</param> /// <returns>A Task containing the RPC response.</returns> public virtual stt::Task <MutateFeedItemsResponse> MutateFeedItemsAsync(MutateFeedItemsRequest request, st::CancellationToken cancellationToken) => MutateFeedItemsAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken));
/// <summary> /// Creates, updates, or removes feed items. Operation statuses are /// returned. /// </summary> /// <param name="request">The request object containing all of the parameters for the API call.</param> /// <param name="callSettings">If not null, applies overrides to this RPC call.</param> /// <returns>A Task containing the RPC response.</returns> public virtual stt::Task <MutateFeedItemsResponse> MutateFeedItemsAsync(MutateFeedItemsRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException();