public void DeleteCardAccountSuccessfully() { var repo = new CardAccountRepository(); var userId = "ec9bf096-c505-4bef-87f6-18822b9dbf2c"; //some user created before var account = new CardAccount { UserId = userId, Active = true, Card = new Card { FullName = "Batman", ExpiryMonth = "11", ExpiryYear = "2020", Number = "4111111111111111", Type = "visa", CVV = "123" } }; var createdAccount = repo.CreateCardAccount(account); Assert.IsTrue(createdAccount.Active); var result = repo.DeleteCardAccount(createdAccount.Id); Assert.IsTrue(result); var gotAccount = repo.GetCardAccountById(createdAccount.Id); Assert.IsFalse(gotAccount.Active); }
public void GetCardAccountSuccessfully() { var content = File.ReadAllText("../../Fixtures/card_account_get_by_id.json"); var client = GetMockClient(content); var repo = new CardAccountRepository(client.Object); var gotAccount = repo.GetCardAccountById("25d34744-8ef0-46a4-8b18-2a8322933cd1"); client.VerifyAll(); Assert.AreEqual("25d34744-8ef0-46a4-8b18-2a8322933cd1", gotAccount.Id); }
public void GetCardAccountEmptyId() { var client = GetMockClient(""); var repo = new CardAccountRepository(client.Object); repo.GetCardAccountById(string.Empty); }
public void GetCardAccountEmptyId() { var repo = new CardAccountRepository(); repo.GetCardAccountById(string.Empty); }