public void ShouldNoAuthenticateWhenEmailIsWrong() { var exp = UserSpecs.AuthenticateUser("*****@*****.**", "12345"); var user = _users.AsQueryable().Where(exp).FirstOrDefault(); Assert.AreEqual(null, user); }
public void AuthenticateUserSpecShouldReturnZero() { var query = UserSpecs.AuthenticateUser("marcosbaiao222", "marcosbaiao"); var count = _users.Where(query).Count(); Assert.AreEqual(0, count); }
public void ShouldNotAuthenticateWhenPasswordIsWrong() { var exp = UserSpecs.AuthenticateUser("*****@*****.**", "1233456"); var user = _users.AsQueryable().Where(exp).FirstOrDefault(); Assert.AreEqual(null, user); }
public User Authenticate(string username, string password) { return(_context.User .Include("ProfileUser") .Where(UserSpecs.AuthenticateUser(username, password)) .FirstOrDefault()); }
public void ShouldNotAuthenticateWhenEmailIsWrong() { var exp = UserSpecs.AuthenticateUser("*****@*****.**", "123456"); var user = _users.AsQueryable().Where(exp).FirstOrDefault(); Assert.AreEqual(null, user); }
public void ShouldNotAuthenticateWhenPasswordIsWrong() { var expression = UserSpecs.AuthenticateUser("*****@*****.**", "13456"); var user = _users.AsQueryable().Where(expression).FirstOrDefault(); Assert.AreEqual(null, user); }
public void AuthenticateUserSpecShouldReturnZero() { var query = UserSpecs.AuthenticateUser("andrebaltieri222", "andrebaltieri"); var count = _users.Where(query).Count(); Assert.AreEqual(0, count); }
public void ShouldAuthenticate() { //dado um usuário //se obtém a expressão e retorna valor var expression = UserSpecs.AuthenticateUser("*****@*****.**", "123456"); var user = _users.AsQueryable().Where(expression).FirstOrDefault(); Assert.AreNotEqual(null, user); }
public User Authenticate(string email, string password) { return(_context.Users .Where(UserSpecs.AuthenticateUser(email, password)) .FirstOrDefault()); }
public User Authenticate(string username, string password) { return(_db.Users .Where(UserSpecs.AuthenticateUser(username, password)) .Where(UserSpecs.IsActive()).FirstOrDefault()); }