コード例 #1
0
        public void ProcessPictureExceptionTest()
        {
            Picture   picture           = new Picture();
            IBusiness instagramBusinees = new InstagramBussinessImpl();
            Exception exception         = null;
            string    jsonString        = "";

            try
            {
                picture = instagramBusinees.ProcessPicture(jsonString);
            }
            catch (Exception ex)
            {
                exception = ex;
            }
            Assert.IsNotNull(exception);
        }
コード例 #2
0
        public void ProcessPictureTest()
        {
            Picture   picture           = new Picture();
            IBusiness instagramBusinees = new InstagramBussinessImpl();
            Exception exception         = null;
            string    jsonString        = "{'data': [{'id': '1593619934200949826_5964438851',  'images': { 'standard_resolution': {'width': 640, 'height': 640, 'url': 'https://scontent.cdninstagram.com/t51.2885-15/s640x640/sh0.08/e35/21224058_826641937504407_498517910608674816_n.jpg'}}}], 'meta': {'code': 200}}";

            try
            {
                picture = instagramBusinees.ProcessPicture(jsonString);
            }
            catch (Exception ex)
            {
                exception = ex;
            }
            Assert.IsNull(exception);
            Assert.IsNotNull(picture);
            Assert.AreEqual(picture.url, "https://scontent.cdninstagram.com/t51.2885-15/s640x640/sh0.08/e35/21224058_826641937504407_498517910608674816_n.jpg");
        }