Exemplo n.º 1
0
        public void ListPaymentsAccounts2()
        {
            Mock <PaymentsAccountService.PaymentsAccountServiceClient> mockGrpcClient = new Mock <PaymentsAccountService.PaymentsAccountServiceClient>(MockBehavior.Strict);
            ListPaymentsAccountsRequest request = new ListPaymentsAccountsRequest
            {
                CustomerId = "customerId-1772061412",
            };
            ListPaymentsAccountsResponse expectedResponse = new ListPaymentsAccountsResponse();

            mockGrpcClient.Setup(x => x.ListPaymentsAccounts(request, It.IsAny <CallOptions>()))
            .Returns(expectedResponse);
            PaymentsAccountServiceClient client   = new PaymentsAccountServiceClientImpl(mockGrpcClient.Object, null);
            ListPaymentsAccountsResponse response = client.ListPaymentsAccounts(request);

            Assert.AreEqual(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
        public void ListPaymentsAccounts()
        {
            moq::Mock <PaymentsAccountService.PaymentsAccountServiceClient> mockGrpcClient = new moq::Mock <PaymentsAccountService.PaymentsAccountServiceClient>(moq::MockBehavior.Strict);
            ListPaymentsAccountsRequest request = new ListPaymentsAccountsRequest
            {
                CustomerId = "customer_id3b3724cb",
            };
            ListPaymentsAccountsResponse expectedResponse = new ListPaymentsAccountsResponse
            {
                PaymentsAccounts =
                {
                    new gagvr::PaymentsAccount(),
                },
            };

            mockGrpcClient.Setup(x => x.ListPaymentsAccounts(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            PaymentsAccountServiceClient client   = new PaymentsAccountServiceClientImpl(mockGrpcClient.Object, null);
            ListPaymentsAccountsResponse response = client.ListPaymentsAccounts(request.CustomerId);

            xunit::Assert.Same(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }