예제 #1
0
        public void LogOut()
        {
            var regData = InstanceFactory.RegistrationData();
            var auth    = InstanceFactory.AuthorizeData(regData);

            AuthorizationService.RegisterMember(regData);
            var token = AuthorizationService.LogIn(auth);

            AuthorizationService.LogOut(token);
        }
예제 #2
0
        public void LogIn_IncorrectPassword()
        {
            RegistrationData regData = InstanceFactory.RegistrationData();
            AuthData         auth    = InstanceFactory.AuthorizeData(regData);

            auth.Password = "******";

            AuthorizationService.RegisterMember(regData);

            Assert.ThrowsException <AuthenticationException>(() => AuthorizationService.LogIn(auth));
        }
예제 #3
0
        public void LogIn_Ok()
        {
            var regData = InstanceFactory.RegistrationData();
            var auth    = InstanceFactory.AuthorizeData(regData);

            AuthorizationService.RegisterMember(regData);
            var token = AuthorizationService.LogIn(auth);

            Assert.IsNotNull(token);
            Assert.AreNotEqual(token.UserId, Guid.Empty);
        }