示例#1
0
 public void ViewTweetTotalTest()
 {
     // Arrange
     HomeController controller = new HomeController();
     // Act
     JsonResult result = controller.ViewTweetTotal() as JsonResult;
     String expected = "[{\"AccountName\":\"pay_by_phone\",\"TotalNumberOfMentionedInTweetForTwoWeek\":4,\"TotalNumberOfTweetForTwoWeek\":20},{\"AccountName\":\"PayByPhone\",\"TotalNumberOfMentionedInTweetForTwoWeek\":9,\"TotalNumberOfTweetForTwoWeek\":4},{\"AccountName\":\"PayByPhone_UK\",\"TotalNumberOfMentionedInTweetForTwoWeek\":0,\"TotalNumberOfTweetForTwoWeek\":4}]";
     Assert.AreEqual(expected, result.Data.ToString());
 }
示例#2
0
        public void ViewTweetListTest()
        {
            // Arrange
            HomeController controller = new HomeController();

            // Act
            JsonResult result = controller.ViewTweetList() as JsonResult;
            String expected = "[{\"AccountName\":\"pay_by_phone\",\"Name\":null,\"Screen_name\":null,\"Description\":null,\"Url\":null,\"Text\":\"RT @BarrieArnold: Seattle rolls out #PayByPhone parking downtown http://t.co/YF7DHWmIaO\",\"Created_at\":\"Fri Jul 19 02:39:18 +0000 2013\",\"Id\":\"358053403257085952\"},{\"Created_at\":\"Fri Jul 19 00:45:52 +0000 2013\",\"Id\":\"358024858464038915\",\"Text\":\"RT @Taylor_Soper: Finally you can use your smartphone to pay for parking remotely in Seattle: http://t.co/fgejD7w1pU @pay_by_phone @mayormc…\",\"AccountName\":\"pay_by_phone\",\"Name\":null,\"Screen_name\":null,\"Description\":null,\"Url\":null},{\"Created_at\":\"Thu Jul 18 21:18:26 +0000 2013\",\"Id\":\"357972655049150464\",\"Text\":\"RT @mayormcginn: You can download the app from @pay_by_phone here: http://t.co/lQhUqHxTyy\",\"AccountName\":\"pay_by_phone\",\"Name\":null,\"Screen_name\":null,\"Description\":null,\"Url\":null},{\"Created_at\":\"Thu Jul 18 21:18:18 +0000 2013\",\"Id\":\"357972619749896192\",\"Text\":\"PayByPhone\\u0027s official #Seattle public launch courtesy of @mayormcginn http://t.co/qgOy2UFRuI\",\"AccountName\":\"pay_by_phone\",\"Name\":null,\"Screen_name\":null,\"Description\":null,\"Url\":null},{\"Created_at\":\"Thu Jul 18 21:04:41 +0000 2013\",\"Id\":\"357969194014343169\",\"Text\":\"#Seattle press conference starting soon with @mayormcginn #PayByPhone http://t.co/owyphUDggp\",\"AccountName\":\"pay_by_phone\",\"Name\":null,\"Screen_name\":null,\"Description\":null,\"Url\":null},{\"Created_at\":\"Thu Jul 18 18:56:29 +0000 2013\",\"Id\":\"357936930832396288\",\"Text\":\"@PacificNormWest Thanks for the warm welcome to Seattle. We\\u0027re currently exploring a windows app. Use http://t.co/yjF39rTXb3 in the meantime\",\"AccountName\":\"pay_by_phone\",\"Name\":null,\"Screen_name\":null,\"Description\":null,\"Url\":null},{\"Created_at\":\"Thu Jul 18 18:46:43 +0000 2013\",\"Id\":\"357934472324333568\",\"Text\":\"#Seattle! You can now #PayByPhone for parking! Get our app and sign up today (search: paybyphone) http://t.co/L0CD5xsOKa\",\"AccountName\":\"pay_by_phone\",\"Name\":null,\"Screen_name\":null,\"Description\":null,\"Url\":null},{\"Created_at\":\"Wed Jul 17 21:49:21 +0000 2013\",\"Id\":\"357618047235792899\",\"Text\":\"We just happen to be in Seattle tomorrow so count us in! RT @postmates_sea: Are YOU ready for #SundaeLove tomorrow? http://t.co/9DCWcQO4Bm\",\"AccountName\":\"pay_by_phone\",\"Name\":null,\"Screen_name\":null,\"Description\":null,\"Url\":null},{\"Created_at\":\"Wed Jul 17 21:35:47 +0000 2013\",\"Id\":\"357614633525321728\",\"Text\":\"We love using @roammobility when traveling to the US. A great #Vancouver company making travel more convenient\",\"AccountName\":\"pay_by_phone\",\"Name\":null,\"Screen_name\":null,\"Description\":null,\"Url\":null},{\"Created_at\":\"Wed Jul 17 13:49:07 +0000 2013\",\"Id\":\"357497193365651456\",\"Text\":\"Good news - the phone line problems are now resolved. If you experienced problems paying to park during this time... http://t.co/Syz2l76oFs\",\"AccountName\":\"PayByPhone_UK\",\"Name\":null,\"Screen_name\":null,\"Description\":null,\"Url\":null},{\"Created_at\":\"Wed Jul 17 12:02:37 +0000 2013\",\"Id\":\"357470390165045248\",\"Text\":\"Intermittent phone line problems may be effecting your ability to call PayByPhone.  You can still pay to park by... http://t.co/RBWOQ5tZkP\",\"AccountName\":\"PayByPhone_UK\",\"Name\":null,\"Screen_name\":null,\"Description\":null,\"Url\":null},{\"Created_at\":\"Wed Jul 17 07:22:05 +0000 2013\",\"Id\":\"357399792969715712\",\"Text\":\"@Seccotine_ on espère Zebuline ! merci pour votre soutien !\",\"AccountName\":\"PayByPhone\",\"Name\":null,\"Screen_name\":null,\"Description\":null,\"Url\":null},{\"Created_at\":\"Tue Jul 16 20:29:20 +0000 2013\",\"Id\":\"357235522806104064\",\"Text\":\"@fcm_mar Thanks for sharing!\",\"AccountName\":\"pay_by_phone\",\"Name\":null,\"Screen_name\":null,\"Description\":null,\"Url\":null},{\"Created_at\":\"Tue Jul 16 17:38:10 +0000 2013\",\"Id\":\"357192449157890049\",\"Text\":\"GoT in the #parking lot! RT @HappyPlace: Correct way to leave a windshield note threatening a \\u0027Game of Thrones\\u0027 fan http://t.co/28FMiwW3XU\",\"AccountName\":\"pay_by_phone\",\"Name\":null,\"Screen_name\":null,\"Description\":null,\"Url\":null},{\"Created_at\":\"Tue Jul 16 16:41:44 +0000 2013\",\"Id\":\"357178245059313665\",\"Text\":\"@missfish Thanks for the great post Andrea. We\\u0027re thrilled you find @pay_by_phone so convenient \\u0026amp; hopefully more #Ottawa drivers will now 2\",\"AccountName\":\"pay_by_phone\",\"Name\":null,\"Screen_name\":null,\"Description\":null,\"Url\":null},{\"Created_at\":\"Tue Jul 16 16:35:16 +0000 2013\",\"Id\":\"357176616474001409\",\"Text\":\"A great blog post today by #Ottawa blogger @missfish about her PayByPhone experience http://t.co/YY9v1Zz2Xk cc @ottawacity\",\"AccountName\":\"pay_by_phone\",\"Name\":null,\"Screen_name\":null,\"Description\":null,\"Url\":null},{\"Created_at\":\"Tue Jul 16 11:53:41 +0000 2013\",\"Id\":\"357105757256286210\",\"Text\":\"@nattamac Hi Natalie,sorry to hear that.If you email your details to [email protected] we will investigate what happened. Thanks\",\"AccountName\":\"PayByPhone_UK\",\"Name\":null,\"Screen_name\":null,\"Description\":null,\"Url\":null},{\"Created_at\":\"Mon Jul 15 16:38:31 +0000 2013\",\"Id\":\"356815049299468289\",\"Text\":\"#Miami! Enter our $1000 Gas Card Giveaway. It\\u0027s week 2 of 4! You can enter once per week here http://t.co/u035iAo4Jz cc @miamiparking\",\"AccountName\":\"pay_by_phone\",\"Name\":null,\"Screen_name\":null,\"Description\":null,\"Url\":null},{\"Created_at\":\"Mon Jul 15 16:26:07 +0000 2013\",\"Id\":\"356811928213012480\",\"Text\":\"#SanFrancisco! Enter our $1000 gas card giveaway. Week 2 of 4 has started! You can enter once per week here http://t.co/ju0XoN3d0s RT!\",\"AccountName\":\"pay_by_phone\",\"Name\":null,\"Screen_name\":null,\"Description\":null,\"Url\":null},{\"Created_at\":\"Mon Jul 15 07:10:37 +0000 2013\",\"Id\":\"356672132559798272\",\"Text\":\"Hi @jamesbromley i am sorry you had issues using the service.If u can email [email protected] with your query we will be happy 2 help\",\"AccountName\":\"PayByPhone_UK\",\"Name\":null,\"Screen_name\":null,\"Description\":null,\"Url\":null},{\"Created_at\":\"Sun Jul 14 00:49:01 +0000 2013\",\"Id\":\"356213710957719554\",\"Text\":\"RT @UrbanCntryStyle: @DaraTorres pay by phone parking app! We have it in Canada. And it texts you when the time is almost up! #thatandfreem…\",\"AccountName\":\"pay_by_phone\",\"Name\":null,\"Screen_name\":null,\"Description\":null,\"Url\":null},{\"Created_at\":\"Sun Jul 14 00:44:30 +0000 2013\",\"Id\":\"356212575719006209\",\"Text\":\"RT @latone: Parking tickets zero: http://t.co/uwEUfuy69a /cc @pay_by_phone\",\"AccountName\":\"pay_by_phone\",\"Name\":null,\"Screen_name\":null,\"Description\":null,\"Url\":null},{\"Created_at\":\"Fri Jul 12 22:35:43 +0000 2013\",\"Id\":\"355817776276975616\",\"Text\":\"Congratulations to our #SanFrancisco Gas Card Contest Winner for Week 1 - Karen Daitch\\n(@daitchy) - check your email for prize details!\",\"AccountName\":\"pay_by_phone\",\"Name\":null,\"Screen_name\":null,\"Description\":null,\"Url\":null},{\"Created_at\":\"Fri Jul 12 19:41:03 +0000 2013\",\"Id\":\"355773822357602304\",\"Text\":\"@realmrsus Happy Birthday! We\\u0027ve emailed you with some details. Have a great weekend!\",\"AccountName\":\"pay_by_phone\",\"Name\":null,\"Screen_name\":null,\"Description\":null,\"Url\":null},{\"Created_at\":\"Fri Jul 12 19:34:11 +0000 2013\",\"Id\":\"355772091632599041\",\"Text\":\"Congratulations to our #Miami Gas Card Contest Winner for Week 1 - Shannon Ford (@RealMrsUS)\",\"AccountName\":\"pay_by_phone\",\"Name\":null,\"Screen_name\":null,\"Description\":null,\"Url\":null},{\"Created_at\":\"Thu Jul 11 22:21:24 +0000 2013\",\"Id\":\"355451785655234560\",\"Text\":\"Après #Issy, #Boulogne, #lehavre, au tour de Paris de s\\u0027intéresser au paiement du stationnement par mobile ! http://t.co/ADwmJPaoW2\",\"AccountName\":\"PayByPhone\",\"Name\":null,\"Screen_name\":null,\"Description\":null,\"Url\":null},{\"Created_at\":\"Thu Jul 11 21:20:53 +0000 2013\",\"Id\":\"355436558565912578\",\"Text\":\"@ppxppx @telematintv oui, merci pour ce rappel à l\\u0027ordre. Déjà 200 villes, la dernière née en France = Le Havre\",\"AccountName\":\"PayByPhone\",\"Name\":null,\"Screen_name\":null,\"Description\":null,\"Url\":null},{\"Created_at\":\"Thu Jul 11 21:11:45 +0000 2013\",\"Id\":\"355434256710905857\",\"Text\":\"Reportage de PayByPhone sur France 3 au Havre ! http://t.co/vbFfBitxxD\",\"AccountName\":\"PayByPhone\",\"Name\":null,\"Screen_name\":null,\"Description\":null,\"Url\":null}]";
            Assert.AreEqual(expected, result.Data.ToString());
        }
示例#3
0
        public void ParseRequestTest()
        {
            HomeController target = new HomeController();
            string accountname = "@pay_by_phone";
            WebResponse response = target.SendRequest(accountname);

            List<TwitterDO> actual;
            actual = target.ParseRequest(response, accountname);
            Assert.AreEqual(20, actual.Count);
        }