Beispiel #1
0
        public void GetByUserNameShouldReturnValue()
        {
            var result = _users.AsQueryable().Where(UserSpecs.GetUserByName("batman")).FirstOrDefault();

            Assert.AreEqual(result.Username, "batman");
        }
Beispiel #2
0
        public void GetByUserNameShouldNotReturnValue()
        {
            var result = _users.AsQueryable().Where(UserSpecs.GetUserByName("superman")).FirstOrDefault();

            Assert.AreEqual(null, result);
        }
Beispiel #3
0
 public User GetUserByUserName(string userName)
 {
     return(_context.Users.Where(UserSpecs.GetUserByName(userName)).FirstOrDefault());
 }