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 DeletePayPalAccountSuccessfully()
        {
            var content = File.ReadAllText("../../Fixtures/paypal_account_delete.json");
            var client = GetMockClient(content);
            var repo = new PayPalAccountRepository(client.Object);

            var result = repo.DeletePayPalAccount("cd2ab053-25e5-491a-a5ec-0c32dbe76efa");
            Assert.IsTrue(result);
        }
Exemplo n.º 3
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);
        }
Exemplo n.º 4
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 GetPayPalAccountSuccessfully()
        {
            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 gotAccount = repo.GetPayPalAccountById(createdAccount.Id);

            Assert.AreEqual(createdAccount.Id, gotAccount.Id);
        }
 public void CreatePayPalAccountSuccessfully()
 {
     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.IsNotNull(createdAccount);
     Assert.IsNotNull(createdAccount.Id);
     Assert.AreEqual("AUD", createdAccount.Currency); // It seems that currency is determined by country
     Assert.IsNotNull(createdAccount.CreatedAt);
     Assert.IsNotNull(createdAccount.UpdatedAt);
 }
Exemplo n.º 7
0
        public void CreatePayPalAccountSuccessfully()
        {
            var content = File.ReadAllText("../../Fixtures/paypal_account_create.json");
            var client = GetMockClient(content);
            var repo = new PayPalAccountRepository(client.Object);

            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.IsNotNull(createdAccount);
            Assert.IsNotNull(createdAccount.Id);
            Assert.AreEqual("AUD", createdAccount.Currency); // It seems that currency is determined by country
            Assert.IsNotNull(createdAccount.CreatedAt);
            Assert.IsNotNull(createdAccount.UpdatedAt);
        }
 public void GetPayPalAccountEmptyId()
 {
     var repo = new PayPalAccountRepository();
     repo.GetPayPalAccountById(string.Empty);
 }