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