Пример #1
0
        public void UT_AccessToken_GetOrAdd_MaxTimeOut()
        {
            var dataProvider = new InMemoryDataProvider();

            dataProvider.SetExtension(typeof(IAccessTokenDataProviderExtension), new InMemoryAccessTokenDataProvider());
            Providers.Instance.DataProvider = dataProvider;

            // ACTION
            var token = AccessTokenVault.GetOrAddToken(1, TimeSpan.MaxValue);

            // ASSERT
            Assert.AreEqual(DateTime.MaxValue, token.ExpirationDate);
        }
Пример #2
0
        public void UT_AccessToken_Create_MaxTimeOut()
        {
            var dataProvider = new InMemoryDataProvider();

            dataProvider.SetExtension(typeof(IAccessTokenDataProviderExtension), new InMemoryAccessTokenDataProvider());
            Providers.Instance.DataProvider = dataProvider;

            // ACTION
            var token = AccessTokenVault.CreateTokenAsync(1, TimeSpan.MaxValue, CancellationToken.None).Result;

            // ASSERT
            Assert.AreEqual(DateTime.MaxValue, token.ExpirationDate);
        }