Exemplo n.º 1
0
        public void GetPayPalAccountEmptyId()
        {
            var client = GetMockClient("");

            var repo = new PayPalAccountRepository(client.Object);

            repo.GetPayPalAccountById(string.Empty);
        }
Exemplo n.º 2
0
        public void GetPayPalAccountSuccessfully()
        {
            var id = "cd2ab053-25e5-491a-a5ec-0c32dbe76efa";
            var content = File.ReadAllText("../../Fixtures/paypal_account_create.json");
            var client = GetMockClient(content);
            var repo = new PayPalAccountRepository(client.Object);

            var gotAccount = repo.GetPayPalAccountById(id);

            Assert.AreEqual(id, gotAccount.Id);
        }
        public void DeletePayPalAccountSuccessfully()
        {
            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);
            Assert.IsTrue(createdAccount.Active);
            var result = repo.DeletePayPalAccount(createdAccount.Id);

            Assert.IsTrue(result);

            var gotAccount = repo.GetPayPalAccountById(createdAccount.Id);
            Assert.IsFalse(gotAccount.Active);
        }
 public void GetPayPalAccountEmptyId()
 {
     var repo = new PayPalAccountRepository();
     repo.GetPayPalAccountById(string.Empty);
 }