public async Task StatusesShow_Test() { using (var twitterApi = new TwitterApi()) { var mock = new Mock <IApiConnection>(); mock.Setup(x => x.GetAsync <TwitterStatus>( new Uri("statuses/show.json", UriKind.Relative), new Dictionary <string, string> { { "id", "100" }, { "include_entities", "true" }, { "include_ext_alt_text", "true" }, { "tweet_mode", "extended" }, }, "/statuses/show/:id") ) .ReturnsAsync(new TwitterStatus { Id = 100L }); twitterApi.apiConnection = mock.Object; await twitterApi.StatusesShow(statusId : 100L) .ConfigureAwait(false); mock.VerifyAll(); } }
public async Task StatusesShow_Test() { using (var twitterApi = new TwitterApi()) { var mock = new Mock<IApiConnection>(); mock.Setup(x => x.GetAsync<TwitterStatus>( new Uri("statuses/show.json", UriKind.Relative), new Dictionary<string, string> { { "id", "100" }, { "include_entities", "true" }, { "include_ext_alt_text", "true" }, { "tweet_mode", "extended" }, }, "/statuses/show/:id") ) .ReturnsAsync(new TwitterStatus { Id = 100L }); twitterApi.apiConnection = mock.Object; await twitterApi.StatusesShow(statusId: 100L) .ConfigureAwait(false); mock.VerifyAll(); } }