public async Task Save_Encrypted_Data_While_Registering_New_Admin() { // arrange const string email = "*****@*****.**"; string emailHash = new Sha256HashingUtil().Sha256HashEncoding1252(email); // act await _service.RegisterAsync( email, "password", "first name", "last name", "phone_number", "company", "department", "jobTitle", new List <Permission>()); // assert _adminUsersRepositoryMock.Verify(o => o.TryCreateAsync(It.Is <AdminUserEncrypted>( adminUserEncrypted => adminUserEncrypted.EmailHash == emailHash))); }
public CustomerCredentialsRepository( MsSqlContextFactory <CredentialsContext> contextFactory, ILogFactory logFactory, Sha256HashingUtil hashingHelper) { _contextFactory = contextFactory; _hashingHelper = hashingHelper; _log = logFactory.CreateLog(this); }
public AdminCredentialsRepository( MsSqlContextFactory <CredentialsContext> contextFactory, IMapper mapper, Sha256HashingUtil hashingHelper) { _contextFactory = contextFactory; _mapper = mapper; _hashingHelper = hashingHelper; }
public void When_CallSha256HashAndPassEncoding1252_Expect_HashedInput() { var hash = "2CF24DBA5FB0A30E26E83B2AC5B9E29E1B161E5C1FA7425E73043362938B9824"; var input = "hello"; var hashedInput = new Sha256HashingUtil().Sha256Hash(input, Encoding.GetEncoding(1252)); Assert.Equal(hash, hashedInput); }
public void When_CallSha256HashEncoding1251WithNonNullParameters_Expect_HashedInput() { var hash = "2CF24DBA5FB0A30E26E83B2AC5B9E29E1B161E5C1FA7425E73043362938B9824"; var input = "hello"; var hashedInput = new Sha256HashingUtil().Sha256HashEncoding1252(input); Assert.Equal(hash, hashedInput); }
public PartnerCredentialsRepository( PostgreSQLContextFactory <CredentialsContext> contextFactory, IMapper mapper, Sha256HashingUtil hashingHelper) { _contextFactory = contextFactory; _mapper = mapper; _hashingHelper = hashingHelper; }
public async Task Save_Encrypted_Data_While_Registering_New_Admin() { // arrange const string email = "*****@*****.**"; string emailHash = new Sha256HashingUtil().Sha256HashEncoding1252(email); var model = GetRegisterRequest(); model.Email = email; // act await _service.RegisterAsync(model); // assert _adminUsersRepositoryMock.Verify(o => o.TryCreateAsync(It.Is <AdminUserEncrypted>( adminUserEncrypted => adminUserEncrypted.EmailHash == emailHash))); }