public void GetAccountIdTest()
        {
            ICacheProvider cacheProvider = new HttpRuntimeCache();
            var target = new AuthenticationProvider(cacheProvider);

            string expected = accountId;
            string actual;
            actual = target.GetAccountId(authenticationId);
            Assert.AreEqual(expected, actual);
        }
        public void CreateAuthenticationIdTest()
        {
            if (string.IsNullOrEmpty(authenticationId))
            {
                ICacheProvider cacheProvider = new HttpRuntimeCache();
                var target = new AuthenticationProvider(cacheProvider);

                string actual;
                actual = target.CreateAuthenticationId(accountId);

                Assert.IsNotNull(actual);
                authenticationId = actual;
            }
        }
Exemplo n.º 3
0
 private static object GetHttpProvider()
 {
     Lock.EnterReadLock();
     try
     {
         {
             if (_provider == null)
             {
                 _provider = new HttpRuntimeCache();
             }
         }
     }
     finally
     {
         Lock.ExitReadLock();
     }
     return _provider;
 }
        public void LogoutTest()
        {
            ICacheProvider cacheProvider = new HttpRuntimeCache();
            var target = new AuthenticationProvider(cacheProvider);

            bool expected = true;
            bool actual;
            actual = target.Logout(authenticationId);
            Assert.AreEqual(expected, actual);
            authenticationId = null;
        }
 public void AuthenticationProviderConstructorTest()
 {
     ICacheProvider cacheProvider = new HttpRuntimeCache();
     var target = new AuthenticationProvider(cacheProvider);
     Assert.IsNotNull(target);
 }
        public void ValidateTest()
        {
            ICacheProvider cacheProvider = new HttpRuntimeCache();
            var target = new AuthenticationProvider(cacheProvider);

            bool expected = true;
            bool actual;
            actual = target.Validate(authenticationId);
            Assert.AreEqual(expected, actual);
        }