Exemplo n.º 1
0
        public void GetUserForPayPalAccountSuccessfully()
        {
            var id = "3a780d4a-5de0-409c-9587-080930ddea3c";

            var content = File.ReadAllText("../../Fixtures/paypal_account_get_users.json");
            var client = GetMockClient(content);
            var repo = new PayPalAccountRepository(client.Object);

            var userId = "ec9bf096-c505-4bef-87f6-18822b9dbf2c"; //some user created before

            var gotUser = repo.GetUserForPayPalAccount(id);

            Assert.IsNotNull(gotUser);

            Assert.AreEqual(userId, gotUser.Id);
        }
        public void GetUserForPayPalAccountSuccessfully()
        {
            var repo = new PayPalAccountRepository();
            var userId = "ec9bf096-c505-4bef-87f6-18822b9dbf2c"; //some user created before
            var account = new PayPalAccount
            {
                UserId = userId,
                Active = true,
                PayPal = new PayPal
                {
                    Email = "*****@*****.**"
                }
            };
            var createdAccount = repo.CreatePayPalAccount(account);

            var gotUser = repo.GetUserForPayPalAccount(createdAccount.Id);

            Assert.IsNotNull(gotUser);

            Assert.AreEqual(userId, gotUser.Id);
        }