Exemple #1
0
        public ValidEmail()
        {
            var app = new Application("*****@*****.**", "password", "password");
              var result = new Registrator().ApplyForMembership(app);

              _result = new MonkeyFist.Services.Reminders().SendReminderTokenToUser("*****@*****.**");
        }
 public ValidApplicationReceived()
 {
     _registrator = new Registrator();
     var app = new Application(email:"*****@*****.**",password:"******",confirm:"password");
     _result = _registrator.ApplyForMembership(app);
     _user = _result.NewUser;
 }
        public LoggingOut()
        {
            var app = new Application("*****@*****.**", "password", "password");
              var regResult = new Registrator().ApplyForMembership(app);

              _loggedOut = new Authenticator().EndUserSession(regResult.SessionToken);
        }
        public CurrentUserWithSessionToken()
        {
            var app = new Application("*****@*****.**", "password", "password");
              var regResult = new Registrator().ApplyForMembership(app);

              _user = new Authenticator().GetCurrentUser(regResult.SessionToken);
        }
 public TokenResponse()
 {
     var app = new Application("*****@*****.**", "password", "password");
       var regResult = new Registrator().ApplyForMembership(app);
       var svc = new MonkeyFist.Services.Reminders().SendReminderTokenToUser(regResult.NewUser.Email);
       result = new MonkeyFist.Services.Reminders().ResetUserPassword(svc.User.ReminderToken, "newPassword");
       user = result.User;
 }
 public ValidApplicationReceived()
     : base()
 {
     _reg = new Registrator();
       var app = new Application(email:"*****@*****.**",password:"******",confirm:"password");
       _result = _reg.ApplyForMembership(app);
       _user = _result.NewUser;
 }
        public ValidTokenLogin()
        {
            //register the new user...
              var app = new Application("*****@*****.**", "password", "password");
              var result = new Registrator().ApplyForMembership(app);

              var auth = new Authenticator();
              _result = auth.AuthenticateUserByToken(result.NewUser.AuthenticationToken.ToString());
        }
        public TokenResponseExpired()
        {
            var app = new Application("*****@*****.**", "password", "password");
              var regResult = new Registrator().ApplyForMembership(app);

              using (var session = new Session()) {
            var user = session.Users.FirstOrDefault(x => x.Email == regResult.NewUser.Email);
            user.ReminderSentAt = DateTime.Now.AddDays(-1);
            session.SaveChanges();
              }

              result = new MonkeyFist.Services.Reminders().ResetUserPassword(regResult.NewUser.ReminderToken, "newPassword");
        }
 public EmptyEmailOrPassword()
 {
     var reg = new Registrator();
       _result = reg.ApplyForMembership(new Application("","password",""));
 }
Exemple #10
0
 public Membership(Configuration config)
 {
     _auth = config.AuthenticationService ?? new Authenticator(config);
       _reg = config.RegistrationService ?? new Registrator(config);
       _reminders = config.ReminderService ?? new Reminders(config);
 }