Exemplo n.º 1
0
        public async void Character_Gets_Default_FindAll_Request_Async()
        {
            var client = new FakeRquestClient();
            var marvel = new MarvelClient("public", "private", client);

            await marvel.Characters.FindAllAsync();

            Assert.AreEqual("characters", client.Request.Resource);
            Assert.AreEqual("20", client.Request.Parameters[0].Value);
            Assert.AreEqual("0", client.Request.Parameters[1].Value);
            Assert.AreEqual(5, client.Request.Parameters.Count);
        }
Exemplo n.º 2
0
        public async void Comics_Gets_Find_Request_Async()
        {
            var client = new FakeRquestClient();
            var marvel = new MarvelClient("public", "private", client);

            await marvel.Comics.FindAsync(123);

            Assert.AreEqual("comics/{id}", client.Request.Resource);
            Assert.AreEqual("20", client.Request.Parameters[0].Value);
            Assert.AreEqual("0", client.Request.Parameters[1].Value);
            Assert.AreEqual("123", client.Request.Parameters[2].Value);
        }
Exemplo n.º 3
0
        public void Creators_Gets_Find_Request()
        {
            var client = new FakeRquestClient();
            var marvel = new MarvelClient("public", "private", client);

            marvel.Creators.Find(123);

            Assert.AreEqual("creators/{id}", client.Request.Resource);
            Assert.AreEqual("20", client.Request.Parameters[0].Value);
            Assert.AreEqual("0", client.Request.Parameters[1].Value);
            Assert.AreEqual("123", client.Request.Parameters[2].Value);
        }
Exemplo n.º 4
0
        public void Comics_Gets_Default_FindAll_Request()
        {
            var client = new FakeRquestClient();

            var marvel = new MarvelClient("public", "private", client);

            marvel.Comics.FindAll();

            Assert.AreEqual("comics", client.Request.Resource);
            Assert.AreEqual("20", client.Request.Parameters[0].Value);
            Assert.AreEqual("0", client.Request.Parameters[1].Value);
            Assert.AreEqual(5, client.Request.Parameters.Count);
        }
Exemplo n.º 5
0
        public async void Character_Gets_Parametarized_FindAll_Request_Async()
        {
            var client = new FakeRquestClient();
            var marvel = new MarvelClient("public", "private", client);

            var parametrs = new NameValueCollection
            {
                { "name", "Thor" },
                { "orderBy", "modified" }
            };

            await marvel.Characters.FindAllAsync(3, 4, parametrs);

            Assert.AreEqual("characters", client.Request.Resource);
            Assert.AreEqual("Thor", client.Request.Parameters[0].Value);
            Assert.AreEqual("modified", client.Request.Parameters[1].Value);
            Assert.AreEqual("3", client.Request.Parameters[2].Value);
            Assert.AreEqual("4", client.Request.Parameters[3].Value);
            Assert.AreEqual(7, client.Request.Parameters.Count);
        }
Exemplo n.º 6
0
        public async void Characters_Gets_Associated_Stories_Async()
        {
            var client = new FakeRquestClient();
            var marvel = new MarvelClient("public", "private", client);

            var parametrs = new NameValueCollection
            {
                { "name", "Thor" },
                { "orderBy", "modified" }
            };

            await marvel.Characters.StoriesAsync(123, 2, 3, parametrs);

            Assert.AreEqual("characters/{id}/stories", client.Request.Resource);
            Assert.AreEqual("Thor", client.Request.Parameters[0].Value);
            Assert.AreEqual("modified", client.Request.Parameters[1].Value);
            Assert.AreEqual("2", client.Request.Parameters[2].Value);
            Assert.AreEqual("3", client.Request.Parameters[3].Value);
            Assert.AreEqual(8, client.Request.Parameters.Count);
        }
Exemplo n.º 7
0
        public void Comics_Gets_Associated_Creators()
        {
            var client = new FakeRquestClient();
            var marvel = new MarvelClient("public", "private", client);

            var parametrs = new NameValueCollection
            {
                { "name", "Thor" },
                { "orderBy", "modified" }
            };

            marvel.Comics.Creators(123, 2, 3, parametrs);

            Assert.AreEqual("comics/{id}/creators", client.Request.Resource);
            Assert.AreEqual("Thor", client.Request.Parameters[0].Value);
            Assert.AreEqual("modified", client.Request.Parameters[1].Value);
            Assert.AreEqual("2", client.Request.Parameters[2].Value);
            Assert.AreEqual("3", client.Request.Parameters[3].Value);
            Assert.AreEqual(8, client.Request.Parameters.Count);
        }