public ShariffControllerTests() { _httpTest = new HttpTest(); _httpTest //xing .RespondWith("{ \"share_counter\": 109 }") //linkin .RespondWith("{ \"count\": 45, \"fCnt\": \"0\", \"fCntPlusOne\": \"1\", \"url\": \"http://www.dotnetgeek.de/about-me\" }") //googleplus .RespondWith("{\"id\": \"p\", " + "\"result\": { " + "\"kind\": \"pos#plusones\", " + "\"id\": \"http://www.dotnetgeek.de/about-me\", " + "\"isSetByViewer\": false, " + "\"metadata\": { " + "\"type\": \"URL\", " + "\"globalCounts\": { " + "\"count\": 5 " + "} " + "}, " + "\"abtk\": \"AEIZW7RCLlF9ulguYp8iJbril2j7SiWeBqorYwHNdpN8uxrf1lJRthyvYT4qhzbsBq5S+lwiewI/\"}}") .RespondWith("{ \"og_object\": { " + "\"id\": \"3333333\", \"description\": \"dotnet.\", " + "\"title\": \"dotnet.\", \"type\": \"website\", " + "\"updated_time\": \"2016-10-09T22:43:47+0000\" }, \"share\": { \"comment_count\": 0, \"share_count\": 672 }," + "\"id\": \"http://www.dotnetgeek.de/about-me\"}"); var logger = new Mock <ILogger <ShariffController> >().Object; var controller = new ShariffController(logger); _actionResult = controller.GetCounts( "http://www.dotnetgeek.de/about-me").Result; }
public void ShouldReturnABadRequestForEmptyParameter() { var logger = new Mock <ILogger <ShariffController> >().Object; var controller = new ShariffController(logger); var actionResult = controller.GetCounts("").Result as StatusCodeResult; Assert.Equal(400, actionResult.StatusCode); }