public void GetBankAccountEmptyId() { var client = GetMockClient(""); var repo = new BankAccountRepository(client.Object); Assert.Throws <ArgumentException>(() => repo.GetBankAccountById(string.Empty)); }
public void GetBankAccountSuccessfully() { var content = File.ReadAllText("../../../Fixtures/bank_account_get_by_id.json"); var client = GetMockClient(content); var repo = new BankAccountRepository(client.Object); const string id = "ec9bf096-c505-4bef-87f6-18822b9dbf2c"; var gotAccount = repo.GetBankAccountById(id); client.VerifyAll(); Assert.AreEqual(id, gotAccount.Id); }
public void GetBankAccountSuccessfully() { var content = File.ReadAllText("../../../Fixtures/bank_account_get_by_id.json"); var client = GetMockClient(content); var repo = new BankAccountRepository(client.Object); const string id = "ec9bf096-c505-4bef-87f6-18822b9dbf2c"; var response = repo.GetBankAccountById(id); client.VerifyAll(); var first = response.Values.First(); var firstJson = JsonConvert.SerializeObject(first); var gotAccount = JsonConvert.DeserializeObject <IDictionary <string, object> >(firstJson); Assert.AreEqual(id, gotAccount["id"]); }