public ActionResult Activation(string email, string activationCode) { if (!String.IsNullOrEmpty(email) && !String.IsNullOrEmpty(activationCode)) { if (email.IsValidEmailAddress() && securityProvider.ValidateRegistration(email.Trim(), activationCode.Trim())) { securityProvider.ActivateAccount(email.Trim(), activationCode.Trim()); return(RedirectToAction("ActivationSuccess")); } } return(View()); }
public void ActivateAccount() { //given var me = SeedData.CreateAdminUser(Context); ISecurityProvider provider = new SecurityProvider(Context, me); var secondUser = SeedData.CreateAdminUser(Context, "Thuli"); var deactivate = provider.DeactivateAccount(secondUser.Id); //when var activate = provider.ActivateAccount(secondUser.Id); //then activate.Deactivated.ShouldBeNull(); }