Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        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);
        }