public void GenerateCredentials_EmptyPassword_ReturnsNull() { UserEntity user = new UserEntity(); user.ID = Guid.NewGuid(); user.FirstName = "Test"; user.UserPassword = string.Empty; PasswordService service = new PasswordService(); UserEntity retrieved = service.GenerateCredentials(user); Assert.IsNull(retrieved); }
public void GenerateCredentials_ValidUserEntity_ReturnedWithFields() { string plaintext = "Password123456789"; UserEntity user = new UserEntity(); user.ID = Guid.NewGuid(); user.FirstName = "Test"; user.UserPassword = "******"; PasswordService service = new PasswordService(); UserEntity retrieved = service.GenerateCredentials(user); StringAssert.DoesNotMatch(plaintext, retrieved.UserPassword); Assert.NotNull(user.Registered); Assert.NotNull(user.Salt); Assert.NotNull(user.UserPassword); }
public void GenerateCredentials_NullUserEntity_ReturnsNull() { PasswordService service = new PasswordService(); UserEntity retrieved = service.GenerateCredentials(null); Assert.IsNull(retrieved); }