Пример #1
0
        public void LoginByNameAndPersistentDoesNotThrowIfNoAnyProfiderSet(
            string userName,
            bool persistent)
        {
            var sut = new SwitchingAuthenticationProvider();

            sut.Login(userName, persistent);
        }
Пример #2
0
 public void LoginCallsSwithcedProviderIfNotNull(
     AuthenticationProvider switchedProvider)
 {
     using (new Switcher <AuthenticationProvider>(switchedProvider))
     {
         var sut = new SwitchingAuthenticationProvider();
         sut.Login(this.user);
         switchedProvider.Received().Login(this.user);
     }
 }
Пример #3
0
        public void LoginCallsDefaultProviderIfNotSwitched(
            AuthenticationProvider defaultProvider)
        {
            var sut = new SwitchingAuthenticationProvider
            {
                DefaultProvider = defaultProvider
            };

            sut.Login(this.user);
            defaultProvider.Received().Login(this.user);
        }
Пример #4
0
 public void LoginByNameAndPersistentCallsSwithcedProviderIfNotNull(
     AuthenticationProvider switchedProvider,
     string userName,
     bool persistent)
 {
     using (new Switcher <AuthenticationProvider>(switchedProvider))
     {
         var sut = new SwitchingAuthenticationProvider();
         sut.Login(userName, persistent);
         switchedProvider.Received().Login(userName, persistent);
     }
 }
Пример #5
0
        public void LoginByNameAndPersistentCallsDefaultProviderIfNotSwitched(
            AuthenticationProvider defaultProvider,
            string userName,
            bool persistent)
        {
            var sut = new SwitchingAuthenticationProvider
            {
                DefaultProvider = defaultProvider
            };

            sut.Login(userName, persistent);
            defaultProvider.Received().Login(userName, persistent);
        }
Пример #6
0
        public void LoginDoesNotThrowIfNoAnyProfiderSet()
        {
            var sut = new SwitchingAuthenticationProvider();

            sut.Login(this.user);
        }