public void testActionListWithUserPostPath200()
        {
            RequestMap inputMap = new RequestMap();

            inputMap.Set("user_id", 11);
            List <UserPostPath> items = UserPostPath.List(inputMap);

            Assert.AreEqual(1, items.Count);

            UserPostPath item = items [0];

            Assert.AreEqual(item.Get("id"), 1);
            Assert.AreEqual(item.Get("title"), "My Title");
            Assert.AreEqual(item.Get("body"), "some body text");
            Assert.AreEqual(item.Get("userId"), 1);
        }
        public void get_user_posts_with_path_Test()
        {
            RequestMap map = new RequestMap();

            map.Set("user_id", "1");



            List <UserPostPath> responseList = UserPostPath.List(map);
            UserPostPath        response     = responseList[0];

            Assert.That("1", Is.EqualTo(response["id"].ToString()).IgnoreCase);
            Assert.That("some body text", Is.EqualTo(response["body"].ToString()).IgnoreCase);
            Assert.That("My Title", Is.EqualTo(response["title"].ToString()).IgnoreCase);
            Assert.That("1", Is.EqualTo(response["userId"].ToString()).IgnoreCase);
        }
Example #3
0
        public void Test_get_user_posts_with_path()
        {
            RequestMap map = new RequestMap();

            map.Set("user_id", "1");


            List <UserPostPath> responseList = UserPostPath.List(map);
            UserPostPath        response     = responseList[0];

            List <string> ignoreAsserts = new List <string>();

            BaseTest.assertEqual(ignoreAsserts, response, "id", "1");
            BaseTest.assertEqual(ignoreAsserts, response, "title", "My Title");
            BaseTest.assertEqual(ignoreAsserts, response, "body", "some body text");
            BaseTest.assertEqual(ignoreAsserts, response, "userId", "1");


            BaseTest.putResponse("get_user_posts_with_path", responseList[0]);
        }
 public void testActionListWithUserPostPath500()
 {
     Assert.Throws <MasterCard.Core.Exceptions.ApiException> (() => UserPostPath.List(), "Error, path paramer: 'user_id' expected but not found in input map");
 }