예제 #1
0
 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"));
     }
 }
예제 #2
0
 public void TestRegistrationFail()
 {
     using (var persistence = GetPersistence())
     {
         var u = persistence.CreateUser("bla", "blub");
         var s = new DiskServiceImpl(persistence);
         s.Register(u.Login, "blub");
     }
 }
예제 #3
0
 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);
     }
 }