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

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

            Assert.AreEqual(1, items.Count);

            UserPostHeader 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);
        }
Ejemplo n.º 2
0
        public void get_user_posts_with_header_Test()
        {
            RequestMap map = new RequestMap();

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



            List <UserPostHeader> responseList = UserPostHeader.List(map);
            UserPostHeader        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);
        }
        public void Test_get_user_posts_with_header()
        {
            RequestMap map = new RequestMap();

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


            List <UserPostHeader> responseList = UserPostHeader.List(map);
            UserPostHeader        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_header", responseList[0]);
        }
 public void testActionListWithUserHdearPath500()
 {
     ApiException ex = Assert.Throws <ApiException> (() => UserPostHeader.List());
 }
Ejemplo n.º 5
0
 public void testActionListWithUserHdearPath500()
 {
     Assert.Throws <MasterCard.Core.Exceptions.InvalidRequestException> (() => UserPostHeader.List(), "Error: Parameter (user_id) is required<br> &nbsp; &nbsp;at throwErrorWithCode (/Users/andrearizzini/Workspace/sdk-core-nodejs/nodejs-server/node_modules/swagger-tools/lib/validators.js:121:13)<br> &nbsp; &nbsp;at Object.module.exports.validateRequiredness (/Users/andrearizzini/Workspace/sdk-core-nodejs/nodejs-server/node_modules/swagger-tools/lib/validators.js:456:5)<br> &nbsp; &nbsp;at /Users/andrearizzini/Workspace/sdk-core-nodejs/nodejs-server/node_modules/swagger-tools/middleware/swagger-validator.js:334:32<br> &nbsp; &nbsp;at /Users/andrearizzini/Workspace/sdk-core-nodejs/nodejs-server/node_modules/async/lib/async.js:356:13<br> &nbsp; &nbsp;at async.forEachOf.async.eachOf (/Users/andrearizzini/Workspace/sdk-core-nodejs/nodejs-server/node_modules/async/lib/async.js:233:13)<br> &nbsp; &nbsp;at _asyncMap (/Users/andrearizzini/Workspace/sdk-core-nodejs/nodejs-server/node_modules/async/lib/async.js:355:9)<br> &nbsp; &nbsp;at Object.map (/Users/andrearizzini/Workspace/sdk-core-nodejs/nodejs-server/node_modules/async/lib/async.js:337:20)<br> &nbsp; &nbsp;at swaggerValidator (/Users/andrearizzini/Workspace/sdk-core-nodejs/nodejs-server/node_modules/swagger-tools/middleware/swagger-validator.js:321:15)<br> &nbsp; &nbsp;at call (/Users/andrearizzini/Workspace/sdk-core-nodejs/nodejs-server/node_modules/connect/index.js:239:7)<br> &nbsp; &nbsp;at next (/Users/andrearizzini/Workspace/sdk-core-nodejs/nodejs-server/node_modules/connect/index.js:183:5)");
 }