public void TestRegistration() { using (var persistence = GetPersistence()) { var s = new DiskServiceImpl(persistence); var user = s.Register("bla", "blub"); Assert.AreEqual("bla", user.Login); Assert.AreEqual("blub", user.HashedPassword); Assert.IsFalse(persistence.LoginFree("bla")); } }
public void TestRegistrationFail() { using (var persistence = GetPersistence()) { var u = persistence.CreateUser("bla", "blub"); var s = new DiskServiceImpl(persistence); s.Register(u.Login, "blub"); } }
public void TestRegisterAndLogin() { using (var persistence = GetPersistence()) { var s = new DiskServiceImpl(persistence); s.Register(_userDto.Login, _userDto.HashedPassword); var user = s.Login(_userDto.Login, _userDto.HashedPassword); Assert.IsNotNull(user); } }