public void CreateRepository()
 {
     NewRepo();
     _user1 = new User {Username = "******", Password = "******"};
     Repo.Save(_user1);
     _user2 = new User {Username = "******", Password = "******"};
     Repo.Save(_user2);
 }
예제 #2
0
 public void TestCreateUser()
 {
     var u = new User
     {
         Username = Username,
         Password = Password
     };
     AssertValidEntity(u);
 }
예제 #3
0
 public void Auth(string username, string password)
 {
     var u = _userRepo.FindOne(username);
     if (Equals(u, null))
         throw new ManagerException("Nu exista User!");
     if (u.Password == password)
     {
         _user = u;
     }
     else throw new ManagerException("User incorect!");
 }
예제 #4
0
 public void CreateNewUser(string username, string password)
 {
     var u = new User {Username = username, Password = password};
     _validatorUser.ValidItem(u);
     _userRepo.Save(u);
 }
예제 #5
0
 private void AssertValidEntity(User u)
 {
     Assert.AreEqual(Username, u.Username);
     Assert.AreEqual(Password, u.Password);
 }
 public void FindAll()
 {
     var item = new User {Username = "******", Password = "******"};
     Repo.Save(item);
     AssertLengthRepo(3);
 }