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); }