public async stt::Task UpdateFulfillmentAsync() { moq::Mock <Fulfillments.FulfillmentsClient> mockGrpcClient = new moq::Mock <Fulfillments.FulfillmentsClient>(moq::MockBehavior.Strict); UpdateFulfillmentRequest request = new UpdateFulfillmentRequest { Fulfillment = new Fulfillment(), UpdateMask = new wkt::FieldMask(), }; Fulfillment expectedResponse = new Fulfillment { FulfillmentName = FulfillmentName.FromProject("[PROJECT]"), DisplayName = "display_name137f65c2", GenericWebService = new Fulfillment.Types.GenericWebService(), Enabled = true, Features = { new Fulfillment.Types.Feature(), }, }; mockGrpcClient.Setup(x => x.UpdateFulfillmentAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <Fulfillment>(stt::Task.FromResult(expectedResponse), null, null, null, null)); FulfillmentsClient client = new FulfillmentsClientImpl(mockGrpcClient.Object, null); Fulfillment responseCallSettings = await client.UpdateFulfillmentAsync(request.Fulfillment, request.UpdateMask, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); Fulfillment responseCancellationToken = await client.UpdateFulfillmentAsync(request.Fulfillment, request.UpdateMask, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); }
public void UpdateFulfillment() { moq::Mock <Fulfillments.FulfillmentsClient> mockGrpcClient = new moq::Mock <Fulfillments.FulfillmentsClient>(moq::MockBehavior.Strict); UpdateFulfillmentRequest request = new UpdateFulfillmentRequest { Fulfillment = new Fulfillment(), UpdateMask = new wkt::FieldMask(), }; Fulfillment expectedResponse = new Fulfillment { FulfillmentName = FulfillmentName.FromProject("[PROJECT]"), DisplayName = "display_name137f65c2", GenericWebService = new Fulfillment.Types.GenericWebService(), Enabled = true, Features = { new Fulfillment.Types.Feature(), }, }; mockGrpcClient.Setup(x => x.UpdateFulfillment(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse); FulfillmentsClient client = new FulfillmentsClientImpl(mockGrpcClient.Object, null); Fulfillment response = client.UpdateFulfillment(request.Fulfillment, request.UpdateMask); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); }
/// <summary>Snippet for UpdateFulfillment</summary> public void UpdateFulfillmentRequestObject() { // Snippet: UpdateFulfillment(UpdateFulfillmentRequest, CallSettings) // Create client FulfillmentsClient fulfillmentsClient = FulfillmentsClient.Create(); // Initialize request argument(s) UpdateFulfillmentRequest request = new UpdateFulfillmentRequest { Fulfillment = new Fulfillment(), UpdateMask = new FieldMask(), }; // Make the request Fulfillment response = fulfillmentsClient.UpdateFulfillment(request); // End snippet }
/// <summary>Snippet for UpdateFulfillmentAsync</summary> public async Task UpdateFulfillmentRequestObjectAsync() { // Snippet: UpdateFulfillmentAsync(UpdateFulfillmentRequest, CallSettings) // Additional: UpdateFulfillmentAsync(UpdateFulfillmentRequest, CancellationToken) // Create client FulfillmentsClient fulfillmentsClient = await FulfillmentsClient.CreateAsync(); // Initialize request argument(s) UpdateFulfillmentRequest request = new UpdateFulfillmentRequest { Fulfillment = new Fulfillment(), UpdateMask = new FieldMask(), }; // Make the request Fulfillment response = await fulfillmentsClient.UpdateFulfillmentAsync(request); // End snippet }
/// <summary> /// Updates the fulfillment. /// </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 <Fulfillment> UpdateFulfillmentAsync(UpdateFulfillmentRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_UpdateFulfillmentRequest(ref request, ref callSettings); return(_callUpdateFulfillment.Async(request, callSettings)); }
/// <summary> /// Updates the fulfillment. /// </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>The RPC response.</returns> public override Fulfillment UpdateFulfillment(UpdateFulfillmentRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_UpdateFulfillmentRequest(ref request, ref callSettings); return(_callUpdateFulfillment.Sync(request, callSettings)); }
partial void Modify_UpdateFulfillmentRequest(ref UpdateFulfillmentRequest request, ref gaxgrpc::CallSettings settings);
/// <summary> /// Updates the fulfillment. /// </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 <Fulfillment> UpdateFulfillmentAsync(UpdateFulfillmentRequest request, st::CancellationToken cancellationToken) => UpdateFulfillmentAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken));
/// <summary> /// Updates the fulfillment. /// </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 <Fulfillment> UpdateFulfillmentAsync(UpdateFulfillmentRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException();
/// <summary> /// Updates the fulfillment. /// </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>The RPC response.</returns> public virtual Fulfillment UpdateFulfillment(UpdateFulfillmentRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException();