public async Task FavoritesCreate_Test() { using (var twitterApi = new TwitterApi()) { var mock = new Mock <IApiConnection>(); mock.Setup(x => x.PostLazyAsync <TwitterStatus>( new Uri("favorites/create.json", UriKind.Relative), new Dictionary <string, string> { { "id", "100" }, { "tweet_mode", "extended" }, }) ) .ReturnsAsync(LazyJson.Create(new TwitterStatus { Id = 100L })); twitterApi.apiConnection = mock.Object; await twitterApi.FavoritesCreate(statusId : 100L) .IgnoreResponse() .ConfigureAwait(false); mock.VerifyAll(); } }
public async Task FavoritesCreate_Test() { using (var twitterApi = new TwitterApi()) { var mock = new Mock<IApiConnection>(); mock.Setup(x => x.PostLazyAsync<TwitterStatus>( new Uri("favorites/create.json", UriKind.Relative), new Dictionary<string, string> { { "id", "100" }, { "tweet_mode", "extended" }, }) ) .ReturnsAsync(LazyJson.Create(new TwitterStatus { Id = 100L })); twitterApi.apiConnection = mock.Object; await twitterApi.FavoritesCreate(statusId: 100L) .IgnoreResponse() .ConfigureAwait(false); mock.VerifyAll(); } }