Esempio n. 1
0
        public void GetAccountBudgetProposal2()
        {
            Mock <AccountBudgetProposalService.AccountBudgetProposalServiceClient> mockGrpcClient = new Mock <AccountBudgetProposalService.AccountBudgetProposalServiceClient>(MockBehavior.Strict);
            GetAccountBudgetProposalRequest request = new GetAccountBudgetProposalRequest
            {
                ResourceName = new AccountBudgetProposalName("[CUSTOMER]", "[ACCOUNT_BUDGET_PROPOSAL]").ToString(),
            };
            AccountBudgetProposal expectedResponse = new AccountBudgetProposal
            {
                ResourceName = "resourceName2625949903",
            };

            mockGrpcClient.Setup(x => x.GetAccountBudgetProposal(request, It.IsAny <CallOptions>()))
            .Returns(expectedResponse);
            AccountBudgetProposalServiceClient client = new AccountBudgetProposalServiceClientImpl(mockGrpcClient.Object, null);
            AccountBudgetProposal response            = client.GetAccountBudgetProposal(request);

            Assert.AreEqual(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
Esempio n. 2
0
        public void GetAccountBudgetProposalRequestObject()
        {
            moq::Mock <AccountBudgetProposalService.AccountBudgetProposalServiceClient> mockGrpcClient = new moq::Mock <AccountBudgetProposalService.AccountBudgetProposalServiceClient>(moq::MockBehavior.Strict);
            GetAccountBudgetProposalRequest request = new GetAccountBudgetProposalRequest
            {
                ResourceNameAsAccountBudgetProposalName = gagvr::AccountBudgetProposalName.FromCustomerAccountBudgetProposal("[CUSTOMER_ID]", "[ACCOUNT_BUDGET_PROPOSAL_ID]"),
            };
            gagvr::AccountBudgetProposal expectedResponse = new gagvr::AccountBudgetProposal
            {
                ResourceNameAsAccountBudgetProposalName = gagvr::AccountBudgetProposalName.FromCustomerAccountBudgetProposal("[CUSTOMER_ID]", "[ACCOUNT_BUDGET_PROPOSAL_ID]"),
                ProposalType              = gagve::AccountBudgetProposalTypeEnum.Types.AccountBudgetProposalType.Remove,
                ProposedStartTimeType     = gagve::TimeTypeEnum.Types.TimeType.Unspecified,
                ProposedEndTimeType       = gagve::TimeTypeEnum.Types.TimeType.Unknown,
                ProposedSpendingLimitType = gagve::SpendingLimitTypeEnum.Types.SpendingLimitType.Unknown,
                Status = gagve::AccountBudgetProposalStatusEnum.Types.AccountBudgetProposalStatus.ApprovedHeld,
                ApprovedEndTimeType       = gagve::TimeTypeEnum.Types.TimeType.Forever,
                ApprovedSpendingLimitType = gagve::SpendingLimitTypeEnum.Types.SpendingLimitType.Unknown,
                Id = -6774108720365892680L,
                BillingSetupAsBillingSetupName   = gagvr::BillingSetupName.FromCustomerBillingSetup("[CUSTOMER_ID]", "[BILLING_SETUP_ID]"),
                AccountBudgetAsAccountBudgetName = gagvr::AccountBudgetName.FromCustomerAccountBudget("[CUSTOMER_ID]", "[ACCOUNT_BUDGET_ID]"),
                ProposedName                = "proposed_name7d4b2591",
                ProposedStartDateTime       = "proposed_start_date_time4e2f84a3",
                ApprovedStartDateTime       = "approved_start_date_time20090a2c",
                ProposedEndDateTime         = "proposed_end_date_time39aa28a5",
                ApprovedEndDateTime         = "approved_end_date_time99d3ab5d",
                ProposedSpendingLimitMicros = 6806956772888455592L,
                ApprovedSpendingLimitMicros = 1674109600829643495L,
                ProposedPurchaseOrderNumber = "proposed_purchase_order_numbere58f9418",
                ProposedNotes               = "proposed_notes1d6c3942",
                CreationDateTime            = "creation_date_time2f8c0159",
                ApprovalDateTime            = "approval_date_timecefef4db",
            };

            mockGrpcClient.Setup(x => x.GetAccountBudgetProposal(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            AccountBudgetProposalServiceClient client   = new AccountBudgetProposalServiceClientImpl(mockGrpcClient.Object, null);
            gagvr::AccountBudgetProposal       response = client.GetAccountBudgetProposal(request);

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