Exemple #1
0
        public void QueryPostID1()
        {
            var result = _iPostDAL.QueryDetail <Post>(Helper.GetURL(new RequestObject()
            {
                id = 1, URL = Constants.Posts
            }));

            ////Assert
            Assert.IsTrue(result != null && result.id == 1);
        }
Exemple #2
0
        public void QueryAllPostsOnGetStringException()
        {
            _iPostDAL = new PostDAL(_iLogger, _stubIClient);

            _stubIClient.GetResponseHttpClientString = (arg1, arg2) =>
            {
                throw new Exception();
            };
            _iPostDAL.QueryDetail <Post>(Helper.GetURL(new RequestObject()
            {
                URL = ""
            }));
        }
Exemple #3
0
        public void QueryAllPostsOnGetStringIsNull()
        {
            try
            {
                _iPostDAL = new PostDAL(_iLogger, _stubIClient);

                _stubIClient.GetResponseHttpClientString = (arg1, arg2) =>
                {
                    return("...");
                };
                _iPostDAL.QueryDetail <Post>(Helper.GetURL(new RequestObject()
                {
                    URL = ""
                }));
            }
            catch (Exception ex)
            {
                Assert.IsTrue(ex.Message == "Input string '...' is not a valid number. Path '', line 1, position 3.");
            }
        }