Пример #1
0
            protected static T InternalServerError <T>(Func <RestResponse <T> > serviceAction)
            {
                ExtentTest test     = ScenarioContext.Current.Get <ExtentTest>();
                var        response = serviceAction.Invoke();

                AssertHooks.AssertStringEquals(test, Convert.ToString(response.StatusCode), Convert.ToString(HttpStatusCode.InternalServerError), "Response's Status Code was not OK(200) for API.");
                return(response.Data);
            }
Пример #2
0
            protected static T PreconditionFailedRequest <T>(Func <RestResponse <T> > serviceAction)
            {
                ExtentTest test     = ScenarioContext.Current.Get <ExtentTest>();
                var        response = serviceAction.Invoke();

                AssertHooks.AssertStringEquals(test, Convert.ToString(response.StatusCode), Convert.ToString(HttpStatusCode.PreconditionFailed), "Response's Status Code was not Not Found(404) for API.");
                return(response.Data);
            }