Exemplo n.º 1
0
        public void CreateUserByTokenVerify()
        {
            UserTokenLogic tokenlogic = new UserTokenLogic();
            var            list       = tokenlogic.GetUsertokenList();
            UserToken      token      = list.FirstOrDefault(u => u.Email == "*****@*****.**");
            bool           status     = tokenlogic.VerifyUserToken(token);

            if (status)
            {
                Registration reg = new Registration();
                reg.FirstName        = "pavithra";
                reg.LastName         = "S";
                reg.OrganizationName = "Fluke";
                reg.Email            = "*****@*****.**";
                reg.Password         = "******";
                reg.PhoneNumber      = "1234567890";

                // string id = logic.CreateUser(reg);
                // Assert.IsTrue(!String.IsNullOrEmpty(id));
            }
            else
            {
                Assert.Fail("Invalid Token");
            }
        }
        public HttpResponseMessage VerifyToken(UserToken t)
        {
            bool status = logic.VerifyUserToken(t);

            if (status)
            {
                return(Request.CreateResponse(HttpStatusCode.OK, "Success"));
            }
            else
            {
                return(Request.CreateErrorResponse(HttpStatusCode.ExpectationFailed, logic.ErrorMessage));
            }
        }