public void LogOut() { var regData = InstanceFactory.RegistrationData(); var auth = InstanceFactory.AuthorizeData(regData); AuthorizationService.RegisterMember(regData); var token = AuthorizationService.LogIn(auth); AuthorizationService.LogOut(token); }
public void LogIn_IncorrectPassword() { RegistrationData regData = InstanceFactory.RegistrationData(); AuthData auth = InstanceFactory.AuthorizeData(regData); auth.Password = "******"; AuthorizationService.RegisterMember(regData); Assert.ThrowsException <AuthenticationException>(() => AuthorizationService.LogIn(auth)); }
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); }