Example #1
0
        public void MutateBillingSetup2()
        {
            Mock <BillingSetupService.BillingSetupServiceClient> mockGrpcClient = new Mock <BillingSetupService.BillingSetupServiceClient>(MockBehavior.Strict);
            MutateBillingSetupRequest request = new MutateBillingSetupRequest
            {
                CustomerId = "customerId-1772061412",
                Operation  = new BillingSetupOperation(),
            };
            MutateBillingSetupResponse expectedResponse = new MutateBillingSetupResponse();

            mockGrpcClient.Setup(x => x.MutateBillingSetup(request, It.IsAny <CallOptions>()))
            .Returns(expectedResponse);
            BillingSetupServiceClient  client   = new BillingSetupServiceClientImpl(mockGrpcClient.Object, null);
            MutateBillingSetupResponse response = client.MutateBillingSetup(request);

            Assert.AreEqual(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
        public void MutateBillingSetup()
        {
            moq::Mock <BillingSetupService.BillingSetupServiceClient> mockGrpcClient = new moq::Mock <BillingSetupService.BillingSetupServiceClient>(moq::MockBehavior.Strict);
            MutateBillingSetupRequest request = new MutateBillingSetupRequest
            {
                CustomerId = "customer_id3b3724cb",
                Operation  = new BillingSetupOperation(),
            };
            MutateBillingSetupResponse expectedResponse = new MutateBillingSetupResponse
            {
                Result = new MutateBillingSetupResult(),
            };

            mockGrpcClient.Setup(x => x.MutateBillingSetup(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            BillingSetupServiceClient  client   = new BillingSetupServiceClientImpl(mockGrpcClient.Object, null);
            MutateBillingSetupResponse response = client.MutateBillingSetup(request.CustomerId, request.Operation);

            Assert.AreEqual(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }