예제 #1
0
        public void WhenValidTweetReturnNoErrors()
        {
            string messageBody = "@twitter1\r\n" +
                                 "We welcomed #TweeParents to Twitter HQ for our first-ever Bring Your Parents to Work Day yesterday. \r\n " +
                                 "B4N @twitter2";

            TweetProcessMessage tweet  = new TweetProcessMessage();
            List <string>       errors = new List <string>();
            int expectedErrors         = 0;

            errors = tweet.RunValidation(messageBody);
            int errorsCount = errors.Count;

            Assert.AreEqual(expectedErrors, errorsCount);
        }
예제 #2
0
        public void WhenInvalidTwitterLengthReturnError()
        {
            string messageBody = "@twitterID \r\n" +
                                 "We welcomed #TweeParents to Twitter HQ for our first-ever Bring Your Parents to Work Day yesterday. \r\n " +
                                 "We welcomed #TweeParents to Twitter HQ for our first-ever Bring Your Parents to Work Day yesterday. B4N @twitter2";

            TweetProcessMessage tweet          = new TweetProcessMessage();
            List <string>       errors         = new List <string>();
            List <string>       expectedErrors = new List <string>();

            expectedErrors.Add("Message too long");

            errors = tweet.RunValidation(messageBody);

            Assert.AreEqual(expectedErrors[0], errors[0]);
        }