public void GetBillingSetup()
        {
            moq::Mock <BillingSetupService.BillingSetupServiceClient> mockGrpcClient = new moq::Mock <BillingSetupService.BillingSetupServiceClient>(moq::MockBehavior.Strict);
            GetBillingSetupRequest request = new GetBillingSetupRequest
            {
                ResourceNameAsBillingSetupName = gagvr::BillingSetupName.FromCustomerBillingSetup("[CUSTOMER]", "[BILLING_SETUP]"),
            };
            gagvr::BillingSetup expectedResponse = new gagvr::BillingSetup
            {
                ResourceNameAsBillingSetupName = gagvr::BillingSetupName.FromCustomerBillingSetup("[CUSTOMER]", "[BILLING_SETUP]"),
                Id            = -6774108720365892680L,
                Status        = gagve::BillingSetupStatusEnum.Types.BillingSetupStatus.Pending,
                StartDateTime = "start_date_timeea924cb1",
                StartTimeType = gagve::TimeTypeEnum.Types.TimeType.Unknown,
                PaymentsAccountAsPaymentsAccountName = gagvr::PaymentsAccountName.FromCustomerPaymentsAccount("[CUSTOMER]", "[PAYMENTS_ACCOUNT]"),
                PaymentsAccountInfo = new gagvr::BillingSetup.Types.PaymentsAccountInfo(),
                EndDateTime         = "end_date_timea95363f3",
                EndTimeType         = gagve::TimeTypeEnum.Types.TimeType.Unspecified,
            };

            mockGrpcClient.Setup(x => x.GetBillingSetup(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            BillingSetupServiceClient client   = new BillingSetupServiceClientImpl(mockGrpcClient.Object, null);
            gagvr::BillingSetup       response = client.GetBillingSetup(request.ResourceName);

            Assert.AreEqual(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
Exemple #2
0
        public void GetBillingSetup2()
        {
            Mock <BillingSetupService.BillingSetupServiceClient> mockGrpcClient = new Mock <BillingSetupService.BillingSetupServiceClient>(MockBehavior.Strict);
            GetBillingSetupRequest request = new GetBillingSetupRequest
            {
                ResourceName = new BillingSetupName("[CUSTOMER]", "[BILLING_SETUP]").ToString(),
            };
            BillingSetup expectedResponse = new BillingSetup
            {
                ResourceName = "resourceName2625949903",
            };

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

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