public void CanRegisterEmployerTest() { IEmployerDAO <Employer> EmployerDAO = new EmployerDAO(_connection); Employer testEmployer = new Employer(); string password = testEmployer.Password; testEmployer.FirstName = "Samuel"; testEmployer.LastName = "Cunha"; testEmployer.UserName = "******"; testEmployer.Password = "******"; testEmployer.Email = "*****@*****.**"; testEmployer.Description = "Lorem Ipsum is simply dummy text of the printing and typesetting industry."; testEmployer.Address = "Aparecida"; Employer returned = EmployerDAO.Create(testEmployer); Assert.True(PasswordOperations.VerifyHash("samuel123", returned.Password, returned.PasswordSalt)); _fixture.Dispose(); }
public void CanFindByEmailTest() { IEmployerDAO <Employer> EmployerDAO = new EmployerDAO(_connection); Employer testEmployer = new Employer(); string password = testEmployer.Password; testEmployer.FirstName = "Samuel"; testEmployer.LastName = "Cunha"; testEmployer.UserName = "******"; testEmployer.Password = "******"; testEmployer.Email = "*****@*****.**"; testEmployer.Description = "Lorem Ipsum is simply dummy text of the printing and typesetting industry."; testEmployer.Address = "Aparecida"; Employer returned = EmployerDAO.Create(testEmployer); UserDAO userDAO = new UserDAO(_connection); Assert.NotNull(userDAO.FindUserByEmail("*****@*****.**")); _fixture.Dispose(); }
public void CanRegisterMateWrongPasswordTest() { IMateDAO <Mate> MateDAO = new MateDAO(_connection); Mate testMate = new Mate(); string password = testMate.Password; testMate.FirstName = "Miguel"; testMate.LastName = "Dev"; testMate.UserName = "******"; testMate.Password = "******"; testMate.Email = "*****@*****.**"; testMate.Description = "Lorem Ipsum is simply dummy text of the printing and typesetting industry."; testMate.Address = "Figueir"; testMate.Categories = new[] { Categories.CLEANING, Categories.PLUMBING }; testMate.Rank = Ranks.SUPER_MATE; testMate.Range = 20; Mate returned = MateDAO.Create(testMate); Assert.False(PasswordOperations.VerifyHash("12345", returned.Password, returned.PasswordSalt)); _fixture.Dispose(); }