Пример #1
0
        public void GetCardAccountEmptyId()
        {
            var client = GetMockClient("");
            var repo   = new CardAccountRepository(client.Object);

            Assert.Throws <ArgumentException>(() => repo.GetCardAccountById(string.Empty));
        }
        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);
        }
Пример #3
0
        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 resp   = repo.GetCardAccountById("25d34744-8ef0-46a4-8b18-2a8322933cd1");

            client.VerifyAll();
            var result     = resp.Values.First();
            var gotAccount = JsonConvert.DeserializeObject <IDictionary <string, object> >(JsonConvert.SerializeObject(result));

            Assert.AreEqual("25d34744-8ef0-46a4-8b18-2a8322933cd1", gotAccount["id"]);
        }