public async Task SucessfullyCreatesTokenOnFirstMethodCallAfterCreation() { var apiToken = new ChoiceViewApiToken(_clientId, _clientSecret); var token = await apiToken.GetToken(); Assert.NotNull(token); Assert.NotNull(apiToken.BearerToken); Assert.True(apiToken.TokenExpiration > DateTime.Now); }
public void CorrentPropertyInitializationOnCreation() { var lowerExpirationDate = DateTime.Now; var apiToken = new ChoiceViewApiToken(_clientId, _clientSecret); Assert.Null(apiToken.BearerToken); Assert.False(apiToken.TokenExpiration > DateTime.Now); Assert.InRange(apiToken.TokenExpiration, lowerExpirationDate, DateTime.Now); }