public void MutateExperimentArms() { moq::Mock <ExperimentArmService.ExperimentArmServiceClient> mockGrpcClient = new moq::Mock <ExperimentArmService.ExperimentArmServiceClient>(moq::MockBehavior.Strict); MutateExperimentArmsRequest request = new MutateExperimentArmsRequest { CustomerId = "customer_id3b3724cb", Operations = { new ExperimentArmOperation(), }, }; MutateExperimentArmsResponse expectedResponse = new MutateExperimentArmsResponse { PartialFailureError = new gr::Status(), Results = { new MutateExperimentArmResult(), }, }; mockGrpcClient.Setup(x => x.MutateExperimentArms(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse); ExperimentArmServiceClient client = new ExperimentArmServiceClientImpl(mockGrpcClient.Object, null); MutateExperimentArmsResponse response = client.MutateExperimentArms(request.CustomerId, request.Operations); Assert.AreEqual(expectedResponse, response); mockGrpcClient.VerifyAll(); }
public async stt::Task MutateExperimentArmsRequestObjectAsync() { moq::Mock <ExperimentArmService.ExperimentArmServiceClient> mockGrpcClient = new moq::Mock <ExperimentArmService.ExperimentArmServiceClient>(moq::MockBehavior.Strict); MutateExperimentArmsRequest request = new MutateExperimentArmsRequest { CustomerId = "customer_id3b3724cb", Operations = { new ExperimentArmOperation(), }, PartialFailure = false, ValidateOnly = true, ResponseContentType = gagve::ResponseContentTypeEnum.Types.ResponseContentType.ResourceNameOnly, }; MutateExperimentArmsResponse expectedResponse = new MutateExperimentArmsResponse { PartialFailureError = new gr::Status(), Results = { new MutateExperimentArmResult(), }, }; mockGrpcClient.Setup(x => x.MutateExperimentArmsAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <MutateExperimentArmsResponse>(stt::Task.FromResult(expectedResponse), null, null, null, null)); ExperimentArmServiceClient client = new ExperimentArmServiceClientImpl(mockGrpcClient.Object, null); MutateExperimentArmsResponse responseCallSettings = await client.MutateExperimentArmsAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); Assert.AreEqual(expectedResponse, responseCallSettings); MutateExperimentArmsResponse responseCancellationToken = await client.MutateExperimentArmsAsync(request, st::CancellationToken.None); Assert.AreEqual(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); }
/// <summary> /// Creates, updates, or removes experiment arms. Operation statuses are /// returned. /// /// List of thrown errors: /// [AuthenticationError]() /// [AuthorizationError]() /// [ExperimentArmError]() /// [HeaderError]() /// [InternalError]() /// [QuotaError]() /// [RequestError]() /// </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 <MutateExperimentArmsResponse> MutateExperimentArmsAsync(MutateExperimentArmsRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_MutateExperimentArmsRequest(ref request, ref callSettings); return(_callMutateExperimentArms.Async(request, callSettings)); }
partial void Modify_MutateExperimentArmsRequest(ref MutateExperimentArmsRequest request, ref gaxgrpc::CallSettings settings);
/// <summary> /// Creates, updates, or removes experiment arms. Operation statuses are /// returned. /// /// List of thrown errors: /// [AuthenticationError]() /// [AuthorizationError]() /// [ExperimentArmError]() /// [HeaderError]() /// [InternalError]() /// [QuotaError]() /// [RequestError]() /// </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 <MutateExperimentArmsResponse> MutateExperimentArmsAsync(MutateExperimentArmsRequest request, st::CancellationToken cancellationToken) => MutateExperimentArmsAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken));
/// <summary> /// Creates, updates, or removes experiment arms. Operation statuses are /// returned. /// /// List of thrown errors: /// [AuthenticationError]() /// [AuthorizationError]() /// [ExperimentArmError]() /// [HeaderError]() /// [InternalError]() /// [QuotaError]() /// [RequestError]() /// </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 <MutateExperimentArmsResponse> MutateExperimentArmsAsync(MutateExperimentArmsRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException();