Ejemplo n.º 1
0
        public void UserDoesNotExist()
        {
            UserCredential token = new UserCredential("user", "token");

            AddToBlackList add = new AddToBlackList()
            {
                userCredentia = token
            };

            var response = (LogoutResponseDTO)add.Execute().Result;

            Assert.False(response.isSuccessful);
        }
Ejemplo n.º 2
0
        public void SuccessfulAdd()
        {
            UserCredential token = new UserCredential("hi", "token");

            AddToBlackList add = new AddToBlackList()
            {
                userCredentia = token
            };

            var response = (LogoutResponseDTO)add.Execute().Result;

            Assert.True(response.isSuccessful);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// add token to login gateway
        /// </summary>
        /// <param name="userCredential">username and token</param>
        /// <returns>responseDTO with true or false</returns>
        public LogoutResponseDTO logout(UserCredential userCredential)
        {
            LoginGateway logoutGateway = new LoginGateway();

            var addToBlackList = new AddToBlackList()
            {
                userCredentia = userCredential
            };

            var response = (LogoutResponseDTO)addToBlackList.Execute().Result;

            response.Messages = new List <string>();

            if (response.isSuccessful == false)
            {
                response.Messages.Add("Failed To Logout");
                return(response);
            }

            response.Messages.Add("Success!");
            return(response);
        }