Ejemplo n.º 1
0
        public void GetBankAccountEmptyId()
        {
            var client = GetMockClient("");
            var repo   = new BankAccountRepository(client.Object);

            Assert.Throws <ArgumentException>(() => repo.GetBankAccountById(string.Empty));
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        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"]);
        }