public async Task GetBearerTokenTest() { string formattedToken = EncryptionUtility.DecodeBase64(_consumerKey) + ":" + EncryptionUtility.DecodeBase64(_consumerSecret); string formattedUrl = string.Format(_searchUrl, "nature", 20); string authorizationToken = "Bearer " + await HttpUtility.GetTwitterBearerToken(_authorizationUrl, formattedToken); Assert.IsTrue(!string.IsNullOrWhiteSpace(authorizationToken)); }
public async Task GetTwitterResponseTest() { string formattedToken = EncryptionUtility.DecodeBase64(_consumerKey) + ":" + EncryptionUtility.DecodeBase64(_consumerSecret); string formattedUrl = string.Format(_searchUrl, "nature", 20); string authorizationToken = "Bearer " + await HttpUtility.GetTwitterBearerToken(_authorizationUrl, formattedToken); string response = await HttpUtility.GetTwitterSearchResponse(formattedUrl, authorizationToken); var twitterResponseResult = JsonConvert.DeserializeObject <TwitterSearchMetaData>(response); Assert.IsNotNull(twitterResponseResult); }