Ejemplo n.º 1
0
        private static ResultModel Authenticate(string login, string password)
        {
            var userAppService = new UserAppService();
            var authResult     = userAppService.AuthenticateUser(login, password);

            return(authResult);
        }
Ejemplo n.º 2
0
        public void AuthenticateUserTest_DadosInvalidos()
        {
            string login          = string.Empty;
            string password       = string.Empty;
            var    userAppService = new UserAppService();
            var    authResult     = (ResultModelSingle <User>)userAppService.AuthenticateUser(login, password);

            Assert.IsFalse(authResult.IsSuccess);
            Assert.IsNull(authResult.ResultObject);
        }
Ejemplo n.º 3
0
        public void AuthenticateUserTest_DadosValidos()
        {
            string login          = "******";
            string password       = "******";
            var    userAppService = new UserAppService();
            var    authResult     = (ResultModelSingle <User>)userAppService.AuthenticateUser(login, password);

            Assert.IsNotNull(authResult);
            Assert.IsTrue(authResult.ResultObject.Id > 0);
            Assert.AreEqual(authResult.ResultObject.Login, login);
        }