Esempio n. 1
0
        public void ParseResultBase_should_parse_ErrorMessage_as_null_when_success()
        {
            XDocument          xDoc = XDocument.Parse(_successfulResult);
            NotificationResult notificationResult = new NotificationResult();

            ResultParser.ParseResultBase(xDoc, notificationResult);

            Assert.Null(notificationResult.ErrorMessage);
        }
Esempio n. 2
0
        public void ParseResultBase_should_parse_TimeStamp_1450936800_correctly()
        {
            XDocument          xDoc = XDocument.Parse(_successfulResult);
            NotificationResult notificationResult = new NotificationResult();

            ResultParser.ParseResultBase(xDoc, notificationResult);

            Assert.Equal("1450936800", notificationResult.TimeStamp);
        }
Esempio n. 3
0
        public void ParseResultBase_should_parse_ResultCode_200_correctly()
        {
            XDocument          xDoc = XDocument.Parse(_successfulResult);
            NotificationResult notificationResult = new NotificationResult();

            ResultParser.ParseResultBase(xDoc, notificationResult);

            Assert.Equal("200", notificationResult.ResultCode);
        }
Esempio n. 4
0
        public void ParseResultBase_should_parse_RemainingCount_988_correctly()
        {
            XDocument          xDoc = XDocument.Parse(_successfulResult);
            NotificationResult notificationResult = new NotificationResult();

            ResultParser.ParseResultBase(xDoc, notificationResult);

            Assert.Equal(988, notificationResult.RemainingMessageCount);
        }
Esempio n. 5
0
        public void ParseResultBase_should_throw_ApplicationException_if_error_in_response()
        {
            XDocument            xDoc   = XDocument.Parse(_errorResult);
            RetrieveApikeyResult result = new RetrieveApikeyResult();

            Assert.Throws(typeof(ApplicationException), delegate
            {
                ResultParser.ParseResultBase(xDoc, result);
            });
        }