public void MutateFeeds() { moq::Mock <FeedService.FeedServiceClient> mockGrpcClient = new moq::Mock <FeedService.FeedServiceClient>(moq::MockBehavior.Strict); MutateFeedsRequest request = new MutateFeedsRequest { CustomerId = "customer_id3b3724cb", Operations = { new FeedOperation(), }, }; MutateFeedsResponse expectedResponse = new MutateFeedsResponse { Results = { new MutateFeedResult(), }, PartialFailureError = new gr::Status(), }; mockGrpcClient.Setup(x => x.MutateFeeds(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse); FeedServiceClient client = new FeedServiceClientImpl(mockGrpcClient.Object, null); MutateFeedsResponse response = client.MutateFeeds(request.CustomerId, request.Operations); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); }
public async stt::Task MutateFeedsAsync() { moq::Mock <FeedService.FeedServiceClient> mockGrpcClient = new moq::Mock <FeedService.FeedServiceClient>(moq::MockBehavior.Strict); MutateFeedsRequest request = new MutateFeedsRequest { CustomerId = "customer_id3b3724cb", Operations = { new FeedOperation(), }, }; MutateFeedsResponse expectedResponse = new MutateFeedsResponse { Results = { new MutateFeedResult(), }, PartialFailureError = new gr::Status(), }; mockGrpcClient.Setup(x => x.MutateFeedsAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <MutateFeedsResponse>(stt::Task.FromResult(expectedResponse), null, null, null, null)); FeedServiceClient client = new FeedServiceClientImpl(mockGrpcClient.Object, null); MutateFeedsResponse responseCallSettings = await client.MutateFeedsAsync(request.CustomerId, request.Operations, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); MutateFeedsResponse responseCancellationToken = await client.MutateFeedsAsync(request.CustomerId, request.Operations, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); }
public void MutateFeedsRequestObject() { moq::Mock <FeedService.FeedServiceClient> mockGrpcClient = new moq::Mock <FeedService.FeedServiceClient>(moq::MockBehavior.Strict); MutateFeedsRequest request = new MutateFeedsRequest { CustomerId = "customer_id3b3724cb", Operations = { new FeedOperation(), }, PartialFailure = false, ValidateOnly = true, ResponseContentType = gagve::ResponseContentTypeEnum.Types.ResponseContentType.ResourceNameOnly, }; MutateFeedsResponse expectedResponse = new MutateFeedsResponse { Results = { new MutateFeedResult(), }, PartialFailureError = new gr::Status(), }; mockGrpcClient.Setup(x => x.MutateFeeds(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse); FeedServiceClient client = new FeedServiceClientImpl(mockGrpcClient.Object, null); MutateFeedsResponse response = client.MutateFeeds(request); Assert.AreEqual(expectedResponse, response); mockGrpcClient.VerifyAll(); }
/// <summary>Snippet for MutateFeeds</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public void MutateFeedsRequestObject() { // Create client FeedServiceClient feedServiceClient = FeedServiceClient.Create(); // Initialize request argument(s) MutateFeedsRequest request = new MutateFeedsRequest { CustomerId = "", Operations = { new FeedOperation(), }, PartialFailure = false, ValidateOnly = false, }; // Make the request MutateFeedsResponse response = feedServiceClient.MutateFeeds(request); }
public async Task MutateFeedsAsync2() { Mock <FeedService.FeedServiceClient> mockGrpcClient = new Mock <FeedService.FeedServiceClient>(MockBehavior.Strict); MutateFeedsRequest request = new MutateFeedsRequest { CustomerId = "customerId-1772061412", Operations = { }, }; MutateFeedsResponse expectedResponse = new MutateFeedsResponse(); mockGrpcClient.Setup(x => x.MutateFeedsAsync(request, It.IsAny <CallOptions>())) .Returns(new Grpc.Core.AsyncUnaryCall <MutateFeedsResponse>(Task.FromResult(expectedResponse), null, null, null, null)); FeedServiceClient client = new FeedServiceClientImpl(mockGrpcClient.Object, null); MutateFeedsResponse response = await client.MutateFeedsAsync(request); Assert.AreEqual(expectedResponse, response); mockGrpcClient.VerifyAll(); }
public void MutateFeeds2() { Mock <FeedService.FeedServiceClient> mockGrpcClient = new Mock <FeedService.FeedServiceClient>(MockBehavior.Strict); MutateFeedsRequest request = new MutateFeedsRequest { CustomerId = "customerId-1772061412", Operations = { }, }; MutateFeedsResponse expectedResponse = new MutateFeedsResponse(); mockGrpcClient.Setup(x => x.MutateFeeds(request, It.IsAny <CallOptions>())) .Returns(expectedResponse); FeedServiceClient client = new FeedServiceClientImpl(mockGrpcClient.Object, null); MutateFeedsResponse response = client.MutateFeeds(request); Assert.AreEqual(expectedResponse, response); mockGrpcClient.VerifyAll(); }
/// <summary>Snippet for MutateFeedsAsync</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 MutateFeedsRequestObjectAsync() { // Create client FeedServiceClient feedServiceClient = await FeedServiceClient.CreateAsync(); // Initialize request argument(s) MutateFeedsRequest request = new MutateFeedsRequest { CustomerId = "", Operations = { new FeedOperation(), }, PartialFailure = false, ValidateOnly = false, ResponseContentType = ResponseContentTypeEnum.Types.ResponseContentType.Unspecified, }; // Make the request MutateFeedsResponse response = await feedServiceClient.MutateFeedsAsync(request); }
/// <summary>Snippet for MutateFeeds</summary> public void MutateFeedsRequestObject() { // Snippet: MutateFeeds(MutateFeedsRequest, CallSettings) // Create client FeedServiceClient feedServiceClient = FeedServiceClient.Create(); // Initialize request argument(s) MutateFeedsRequest request = new MutateFeedsRequest { CustomerId = "", Operations = { new FeedOperation(), }, PartialFailure = false, ValidateOnly = false, ResponseContentType = ResponseContentTypeEnum.Types.ResponseContentType.Unspecified, }; // Make the request MutateFeedsResponse response = feedServiceClient.MutateFeeds(request); // End snippet }
/// <summary>Snippet for MutateFeedsAsync</summary> public async Task MutateFeedsRequestObjectAsync() { // Snippet: MutateFeedsAsync(MutateFeedsRequest, CallSettings) // Additional: MutateFeedsAsync(MutateFeedsRequest, CancellationToken) // Create client FeedServiceClient feedServiceClient = await FeedServiceClient.CreateAsync(); // Initialize request argument(s) MutateFeedsRequest request = new MutateFeedsRequest { CustomerId = "", Operations = { new FeedOperation(), }, PartialFailure = false, ValidateOnly = false, }; // Make the request MutateFeedsResponse response = await feedServiceClient.MutateFeedsAsync(request); // End snippet }
public async Task MutateFeedsAsync() { Mock <FeedService.FeedServiceClient> mockGrpcClient = new Mock <FeedService.FeedServiceClient>(MockBehavior.Strict); MutateFeedsRequest expectedRequest = new MutateFeedsRequest { CustomerId = "customerId-1772061412", Operations = { }, PartialFailure = true, ValidateOnly = false, }; MutateFeedsResponse expectedResponse = new MutateFeedsResponse(); mockGrpcClient.Setup(x => x.MutateFeedsAsync(expectedRequest, It.IsAny <CallOptions>())) .Returns(new Grpc.Core.AsyncUnaryCall <MutateFeedsResponse>(Task.FromResult(expectedResponse), null, null, null, null)); FeedServiceClient client = new FeedServiceClientImpl(mockGrpcClient.Object, null); string customerId = "customerId-1772061412"; IEnumerable <FeedOperation> operations = new List <FeedOperation>(); bool partialFailure = true; bool validateOnly = false; MutateFeedsResponse response = await client.MutateFeedsAsync(customerId, operations, partialFailure, validateOnly); Assert.AreEqual(expectedResponse, response); mockGrpcClient.VerifyAll(); }
/// <summary> /// Creates, updates, or removes feeds. Operation statuses are /// returned. /// /// List of thrown errors: /// [AuthenticationError]() /// [AuthorizationError]() /// [CollectionSizeError]() /// [DatabaseError]() /// [DistinctError]() /// [FeedError]() /// [FieldError]() /// [FieldMaskError]() /// [HeaderError]() /// [IdError]() /// [InternalError]() /// [ListOperationError]() /// [MutateError]() /// [NewResourceCreationError]() /// [NotEmptyError]() /// [NullError]() /// [OperatorError]() /// [QuotaError]() /// [RangeError]() /// [RequestError]() /// [ResourceCountLimitExceededError]() /// [SizeLimitError]() /// [StringFormatError]() /// [StringLengthError]() /// </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 <MutateFeedsResponse> MutateFeedsAsync(MutateFeedsRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_MutateFeedsRequest(ref request, ref callSettings); return(_callMutateFeeds.Async(request, callSettings)); }
/// <summary> /// Creates, updates, or removes feeds. Operation statuses are /// returned. /// /// List of thrown errors: /// [AuthenticationError]() /// [AuthorizationError]() /// [CollectionSizeError]() /// [DatabaseError]() /// [DistinctError]() /// [FeedError]() /// [FieldError]() /// [FieldMaskError]() /// [HeaderError]() /// [IdError]() /// [InternalError]() /// [ListOperationError]() /// [MutateError]() /// [NewResourceCreationError]() /// [NotEmptyError]() /// [NullError]() /// [OperatorError]() /// [QuotaError]() /// [RangeError]() /// [RequestError]() /// [ResourceCountLimitExceededError]() /// [SizeLimitError]() /// [StringFormatError]() /// [StringLengthError]() /// </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 MutateFeedsResponse MutateFeeds(MutateFeedsRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_MutateFeedsRequest(ref request, ref callSettings); return(_callMutateFeeds.Sync(request, callSettings)); }
partial void Modify_MutateFeedsRequest(ref MutateFeedsRequest request, ref gaxgrpc::CallSettings settings);
/// <summary> /// Creates, updates, or removes feeds. Operation statuses are /// returned. /// /// List of thrown errors: /// [AuthenticationError]() /// [AuthorizationError]() /// [CollectionSizeError]() /// [DatabaseError]() /// [DistinctError]() /// [FeedError]() /// [FieldError]() /// [FieldMaskError]() /// [HeaderError]() /// [IdError]() /// [InternalError]() /// [ListOperationError]() /// [MutateError]() /// [NewResourceCreationError]() /// [NotEmptyError]() /// [NullError]() /// [OperatorError]() /// [QuotaError]() /// [RangeError]() /// [RequestError]() /// [ResourceCountLimitExceededError]() /// [SizeLimitError]() /// [StringFormatError]() /// [StringLengthError]() /// </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 <MutateFeedsResponse> MutateFeedsAsync(MutateFeedsRequest request, st::CancellationToken cancellationToken) => MutateFeedsAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken));
/// <summary> /// Creates, updates, or removes feeds. Operation statuses are /// returned. /// /// List of thrown errors: /// [AuthenticationError]() /// [AuthorizationError]() /// [CollectionSizeError]() /// [DatabaseError]() /// [DistinctError]() /// [FeedError]() /// [FieldError]() /// [FieldMaskError]() /// [HeaderError]() /// [IdError]() /// [InternalError]() /// [ListOperationError]() /// [MutateError]() /// [NewResourceCreationError]() /// [NotEmptyError]() /// [NullError]() /// [OperatorError]() /// [QuotaError]() /// [RangeError]() /// [RequestError]() /// [ResourceCountLimitExceededError]() /// [SizeLimitError]() /// [StringFormatError]() /// [StringLengthError]() /// </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 <MutateFeedsResponse> MutateFeedsAsync(MutateFeedsRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException();
/// <summary> /// Creates, updates, or removes feeds. Operation statuses are /// returned. /// /// List of thrown errors: /// [AuthenticationError]() /// [AuthorizationError]() /// [CollectionSizeError]() /// [DatabaseError]() /// [DistinctError]() /// [FeedError]() /// [FieldError]() /// [FieldMaskError]() /// [HeaderError]() /// [IdError]() /// [InternalError]() /// [ListOperationError]() /// [MutateError]() /// [NewResourceCreationError]() /// [NotEmptyError]() /// [NullError]() /// [OperatorError]() /// [QuotaError]() /// [RangeError]() /// [RequestError]() /// [ResourceCountLimitExceededError]() /// [SizeLimitError]() /// [StringFormatError]() /// [StringLengthError]() /// </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 MutateFeedsResponse MutateFeeds(MutateFeedsRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException();