public void MutateConversionCustomVariables() { moq::Mock <ConversionCustomVariableService.ConversionCustomVariableServiceClient> mockGrpcClient = new moq::Mock <ConversionCustomVariableService.ConversionCustomVariableServiceClient>(moq::MockBehavior.Strict); MutateConversionCustomVariablesRequest request = new MutateConversionCustomVariablesRequest { CustomerId = "customer_id3b3724cb", Operations = { new ConversionCustomVariableOperation(), }, }; MutateConversionCustomVariablesResponse expectedResponse = new MutateConversionCustomVariablesResponse { PartialFailureError = new gr::Status(), Results = { new MutateConversionCustomVariableResult(), }, }; mockGrpcClient.Setup(x => x.MutateConversionCustomVariables(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse); ConversionCustomVariableServiceClient client = new ConversionCustomVariableServiceClientImpl(mockGrpcClient.Object, null); MutateConversionCustomVariablesResponse response = client.MutateConversionCustomVariables(request.CustomerId, request.Operations); Assert.AreEqual(expectedResponse, response); mockGrpcClient.VerifyAll(); }
public void MutateConversionCustomVariablesRequestObject() { moq::Mock <ConversionCustomVariableService.ConversionCustomVariableServiceClient> mockGrpcClient = new moq::Mock <ConversionCustomVariableService.ConversionCustomVariableServiceClient>(moq::MockBehavior.Strict); MutateConversionCustomVariablesRequest request = new MutateConversionCustomVariablesRequest { CustomerId = "customer_id3b3724cb", Operations = { new ConversionCustomVariableOperation(), }, PartialFailure = false, ValidateOnly = true, ResponseContentType = gagve::ResponseContentTypeEnum.Types.ResponseContentType.ResourceNameOnly, }; MutateConversionCustomVariablesResponse expectedResponse = new MutateConversionCustomVariablesResponse { PartialFailureError = new gr::Status(), Results = { new MutateConversionCustomVariableResult(), }, }; mockGrpcClient.Setup(x => x.MutateConversionCustomVariables(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse); ConversionCustomVariableServiceClient client = new ConversionCustomVariableServiceClientImpl(mockGrpcClient.Object, null); MutateConversionCustomVariablesResponse response = client.MutateConversionCustomVariables(request); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); }