Exemplo n.º 1
0
        public bool checkforToken()
        {
            IRestResponse res   = _scenerioContext.Get <IRestResponse>("Response");
            var           token = commonMethodsApi.getFromJsonBody("token", res.Content);

            if (token != null)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemplo n.º 2
0
        public bool getLoginToken()
        {
            IRestResponse res   = _scenerioContext.Get <IRestResponse>("Response");
            var           token = commonMethodsApi.getFromJsonBody("token", res.Content);

            if (token != null)
            {
                clearScenerioContext();
                clearFeatureContext();
                _featureContext.Add("Role", commonMethodsApi.getFromJsonBody("Role", res.Content));
                _featureContext.Add("token", token);
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemplo n.º 3
0
        public bool verifyplaceNameandcategoryid()
        {
            IRestResponse res     = _scenerioContext.Get <IRestResponse>("Response");
            var           Details = commonMethodsApi.getobjectfromJson("Details", res.Content);

            if (Details != null)
            {
                var placeName = commonMethodsApi.getFromJsonBody("name", Details.ToString());
                if (placeName != null)
                {
                    var catId = commonMethodsApi.getFromJsonBody("categoryId", Details.ToString());
                    if (catId != null)
                    {
                        if (catId.Equals(_scenerioContext.Get <int>("CatId").ToString()))
                        {
                            if (placeName.Equals(_scenerioContext.Get <string>("PlaceName")))
                            {
                                return(true);
                            }
                            else
                            {
                                return(false);
                            }
                        }
                        else
                        {
                            return(false);
                        }
                    }
                    else
                    {
                        return(false);
                    }
                }
                else
                {
                    return(false);
                }
            }
            else
            {
                return(false);
            }
        }