public void Register_Password_ConfirmPassword_Differents() { // arrange var userRepo = new UserRepoFake(); var context = new UserService(userRepo); // act context.Register("joao", "123456", "123455"); // assert }
public void Register_Duplicate_User() { // arrange var userRepo = new UserRepoFake(); var context = new UserService(userRepo); // act context.Register("felipe", "123456", "123456"); // assert }
public void ChangePassword_Wrong_Password() { // arrange var userRepo = new UserRepoFake(); var context = new UserService(userRepo); // act context.ChangePassword("Felipe", "123455", "2222", "2222"); // assert }
public void ChangePassword_User_NotFound() { // arrange var userRepo = new UserRepoFake(); var context = new UserService(userRepo); // act context.ChangePassword("Joao", "123456", "2222", "2222"); // assert }
public void ChangePassword_Password_ConfirmPassword_Differents() { // arrange var userRepo = new UserRepoFake(); var context = new UserService(userRepo); // act context.ChangePassword("felipe", "123456", "2222", "2223"); var result = userRepo.GetByUserName("felipe"); // assert }
public void ChangePassword_Password_Null() { // arrange var userRepo = new UserRepoFake(); var context = new UserService(userRepo); // act context.ChangePassword("felipe", "123456", null, "2222"); var result = userRepo.GetByUserName("felipe"); // assert }
public void ChangePassword_Valid() { // arrange var userRepo = new UserRepoFake(); var context = new UserService(userRepo); // act context.ChangePassword("felipe", "123456", "2222", "2222"); var result = userRepo.GetByUserName("felipe"); // assert Assert.IsNotNull(result); Assert.AreEqual("2222".Encrypt(), result.Password); }
public void Register_Valid() { // arrange var userRepo = new UserRepoFake(); var context = new UserService(userRepo); // act context.Register("Joao", "123456", "123456"); var result = userRepo.GetByUserName("Joao"); // assert Assert.IsNotNull(result); Assert.AreEqual("123456".Encrypt(), result.Password); Assert.AreEqual(true, result.Active); }