public void GetAccountLink()
        {
            moq::Mock <AccountLinkService.AccountLinkServiceClient> mockGrpcClient = new moq::Mock <AccountLinkService.AccountLinkServiceClient>(moq::MockBehavior.Strict);
            GetAccountLinkRequest request = new GetAccountLinkRequest
            {
                ResourceNameAsAccountLinkName = gagvr::AccountLinkName.FromCustomerAccountLink("[CUSTOMER_ID]", "[ACCOUNT_LINK_ID]"),
            };
            gagvr::AccountLink expectedResponse = new gagvr::AccountLink
            {
                ResourceNameAsAccountLinkName = gagvr::AccountLinkName.FromCustomerAccountLink("[CUSTOMER_ID]", "[ACCOUNT_LINK_ID]"),
                Status = gagve::AccountLinkStatusEnum.Types.AccountLinkStatus.Enabled,
                Type   = gagve::LinkedAccountTypeEnum.Types.LinkedAccountType.Unspecified,
                ThirdPartyAppAnalytics = new gagvr::ThirdPartyAppAnalyticsLinkIdentifier(),
                DataPartner            = new gagvr::DataPartnerLinkIdentifier(),
                GoogleAds     = new gagvr::GoogleAdsLinkIdentifier(),
                AccountLinkId = 2714466098325457917L,
            };

            mockGrpcClient.Setup(x => x.GetAccountLink(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            AccountLinkServiceClient client   = new AccountLinkServiceClientImpl(mockGrpcClient.Object, null);
            gagvr::AccountLink       response = client.GetAccountLink(request.ResourceName);

            xunit::Assert.Same(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
        public async stt::Task MutateAccountLinkRequestObjectAsync()
        {
            moq::Mock <AccountLinkService.AccountLinkServiceClient> mockGrpcClient = new moq::Mock <AccountLinkService.AccountLinkServiceClient>(moq::MockBehavior.Strict);
            MutateAccountLinkRequest request = new MutateAccountLinkRequest
            {
                CustomerId     = "customer_id3b3724cb",
                Operation      = new AccountLinkOperation(),
                PartialFailure = false,
                ValidateOnly   = true,
            };
            MutateAccountLinkResponse expectedResponse = new MutateAccountLinkResponse
            {
                Result = new MutateAccountLinkResult(),
            };

            mockGrpcClient.Setup(x => x.MutateAccountLinkAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <MutateAccountLinkResponse>(stt::Task.FromResult(expectedResponse), null, null, null, null));
            AccountLinkServiceClient  client = new AccountLinkServiceClientImpl(mockGrpcClient.Object, null);
            MutateAccountLinkResponse responseCallSettings = await client.MutateAccountLinkAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None));

            xunit::Assert.Same(expectedResponse, responseCallSettings);
            MutateAccountLinkResponse responseCancellationToken = await client.MutateAccountLinkAsync(request, st::CancellationToken.None);

            xunit::Assert.Same(expectedResponse, responseCancellationToken);
            mockGrpcClient.VerifyAll();
        }
        public async stt::Task GetAccountLinkRequestObjectAsync()
        {
            moq::Mock <AccountLinkService.AccountLinkServiceClient> mockGrpcClient = new moq::Mock <AccountLinkService.AccountLinkServiceClient>(moq::MockBehavior.Strict);
            GetAccountLinkRequest request = new GetAccountLinkRequest
            {
                ResourceNameAsAccountLinkName = gagvr::AccountLinkName.FromCustomerAccountLink("[CUSTOMER_ID]", "[ACCOUNT_LINK_ID]"),
            };
            gagvr::AccountLink expectedResponse = new gagvr::AccountLink
            {
                ResourceNameAsAccountLinkName = gagvr::AccountLinkName.FromCustomerAccountLink("[CUSTOMER_ID]", "[ACCOUNT_LINK_ID]"),
                Status = gagve::AccountLinkStatusEnum.Types.AccountLinkStatus.Enabled,
                Type   = gagve::LinkedAccountTypeEnum.Types.LinkedAccountType.Unspecified,
                ThirdPartyAppAnalytics = new gagvr::ThirdPartyAppAnalyticsLinkIdentifier(),
                DataPartner            = new gagvr::DataPartnerLinkIdentifier(),
                GoogleAds     = new gagvr::GoogleAdsLinkIdentifier(),
                AccountLinkId = 2714466098325457917L,
            };

            mockGrpcClient.Setup(x => x.GetAccountLinkAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <gagvr::AccountLink>(stt::Task.FromResult(expectedResponse), null, null, null, null));
            AccountLinkServiceClient client = new AccountLinkServiceClientImpl(mockGrpcClient.Object, null);
            gagvr::AccountLink       responseCallSettings = await client.GetAccountLinkAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None));

            xunit::Assert.Same(expectedResponse, responseCallSettings);
            gagvr::AccountLink responseCancellationToken = await client.GetAccountLinkAsync(request, st::CancellationToken.None);

            xunit::Assert.Same(expectedResponse, responseCancellationToken);
            mockGrpcClient.VerifyAll();
        }
        public void MutateAccountLink()
        {
            moq::Mock <AccountLinkService.AccountLinkServiceClient> mockGrpcClient = new moq::Mock <AccountLinkService.AccountLinkServiceClient>(moq::MockBehavior.Strict);
            MutateAccountLinkRequest request = new MutateAccountLinkRequest
            {
                CustomerId = "customer_id3b3724cb",
                Operation  = new AccountLinkOperation(),
            };
            MutateAccountLinkResponse expectedResponse = new MutateAccountLinkResponse
            {
                Result = new MutateAccountLinkResult(),
            };

            mockGrpcClient.Setup(x => x.MutateAccountLink(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            AccountLinkServiceClient  client   = new AccountLinkServiceClientImpl(mockGrpcClient.Object, null);
            MutateAccountLinkResponse response = client.MutateAccountLink(request.CustomerId, request.Operation);

            xunit::Assert.Same(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
        public void CreateAccountLink()
        {
            moq::Mock <AccountLinkService.AccountLinkServiceClient> mockGrpcClient = new moq::Mock <AccountLinkService.AccountLinkServiceClient>(moq::MockBehavior.Strict);
            CreateAccountLinkRequest request = new CreateAccountLinkRequest
            {
                CustomerId  = "customer_id3b3724cb",
                AccountLink = new gagvr::AccountLink(),
            };
            CreateAccountLinkResponse expectedResponse = new CreateAccountLinkResponse
            {
                ResourceName = "resource_name8cc2e687",
            };

            mockGrpcClient.Setup(x => x.CreateAccountLink(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            AccountLinkServiceClient  client   = new AccountLinkServiceClientImpl(mockGrpcClient.Object, null);
            CreateAccountLinkResponse response = client.CreateAccountLink(request.CustomerId, request.AccountLink);

            xunit::Assert.Same(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
Пример #6
0
        public void CreateAccountLink()
        {
            moq::Mock <AccountLinkService.AccountLinkServiceClient> mockGrpcClient = new moq::Mock <AccountLinkService.AccountLinkServiceClient>(moq::MockBehavior.Strict);
            CreateAccountLinkRequest request = new CreateAccountLinkRequest
            {
                CustomerId  = "customer_id3b3724cb",
                AccountLink = new gagvr::AccountLink(),
            };
            CreateAccountLinkResponse expectedResponse = new CreateAccountLinkResponse
            {
                ResourceNameAsAccountLinkName = gagvr::AccountLinkName.FromCustomerAccountLink("[CUSTOMER_ID]", "[ACCOUNT_LINK_ID]"),
            };

            mockGrpcClient.Setup(x => x.CreateAccountLink(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            AccountLinkServiceClient  client   = new AccountLinkServiceClientImpl(mockGrpcClient.Object, null);
            CreateAccountLinkResponse response = client.CreateAccountLink(request.CustomerId, request.AccountLink);

            Assert.AreEqual(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
        public void MutateAccountLinkRequestObject()
        {
            moq::Mock <AccountLinkService.AccountLinkServiceClient> mockGrpcClient = new moq::Mock <AccountLinkService.AccountLinkServiceClient>(moq::MockBehavior.Strict);
            MutateAccountLinkRequest request = new MutateAccountLinkRequest
            {
                CustomerId     = "customer_id3b3724cb",
                Operation      = new AccountLinkOperation(),
                PartialFailure = false,
                ValidateOnly   = true,
            };
            MutateAccountLinkResponse expectedResponse = new MutateAccountLinkResponse
            {
                Result = new MutateAccountLinkResult(),
            };

            mockGrpcClient.Setup(x => x.MutateAccountLink(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            AccountLinkServiceClient  client   = new AccountLinkServiceClientImpl(mockGrpcClient.Object, null);
            MutateAccountLinkResponse response = client.MutateAccountLink(request);

            Assert.AreEqual(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
        public async stt::Task CreateAccountLinkAsync()
        {
            moq::Mock <AccountLinkService.AccountLinkServiceClient> mockGrpcClient = new moq::Mock <AccountLinkService.AccountLinkServiceClient>(moq::MockBehavior.Strict);
            CreateAccountLinkRequest request = new CreateAccountLinkRequest
            {
                CustomerId  = "customer_id3b3724cb",
                AccountLink = new gagvr::AccountLink(),
            };
            CreateAccountLinkResponse expectedResponse = new CreateAccountLinkResponse
            {
                ResourceName = "resource_name8cc2e687",
            };

            mockGrpcClient.Setup(x => x.CreateAccountLinkAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <CreateAccountLinkResponse>(stt::Task.FromResult(expectedResponse), null, null, null, null));
            AccountLinkServiceClient  client = new AccountLinkServiceClientImpl(mockGrpcClient.Object, null);
            CreateAccountLinkResponse responseCallSettings = await client.CreateAccountLinkAsync(request.CustomerId, request.AccountLink, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None));

            xunit::Assert.Same(expectedResponse, responseCallSettings);
            CreateAccountLinkResponse responseCancellationToken = await client.CreateAccountLinkAsync(request.CustomerId, request.AccountLink, st::CancellationToken.None);

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