public async Task Loader_Should_Return_0_Without_Any_Tweets() { const string responseData = "{'count':0,'url':'http://...url...'}"; var messageResponse = FakeHttpMessageHandler.GetStringHttpResponseMessage(responseData); var fakeMessageHandler = new FakeHttpMessageHandler("*", messageResponse); var sut = new TwitterTweetCountLoader(fakeMessageHandler); Assert.Equal(0, await sut.GetAsync("http://blog.something.com")); }
public async Task Loader_Should_Return_0_On_HttpError() { const string responseData = "Bad Request"; var messageResponse = FakeHttpMessageHandler.GetStringHttpResponseMessage(responseData, HttpStatusCode.BadRequest); var fakeMessageHandler = new FakeHttpMessageHandler("*", messageResponse); var sut = new TwitterTweetCountLoader(fakeMessageHandler); Assert.Equal(0, await sut.GetAsync("http://blog.something.com")); }