public void GetByUserNameShouldReturnValue() { var result = _users.AsQueryable().Where(UserSpecs.GetUserByName("batman")).FirstOrDefault(); Assert.AreEqual(result.Username, "batman"); }
public void GetByUserNameShouldNotReturnValue() { var result = _users.AsQueryable().Where(UserSpecs.GetUserByName("superman")).FirstOrDefault(); Assert.AreEqual(null, result); }
public User GetUserByUserName(string userName) { return(_context.Users.Where(UserSpecs.GetUserByName(userName)).FirstOrDefault()); }