public void WhenIGetTheCreatedPost() { var createdPost = _scenarioContext.PostRapidApiResponse.ParseResponse <BlogPost>(); var getRequest = new WebRequestBuilder($"{ApiRootUrl}/blogPosts/{createdPost.id}") .WithRequestMethod(HttpMethod.Get) .Build(); _scenarioContext.GetRapidApiResponse = ApiRequestProcessor.Call(getRequest); }
private void CreateNewBlogPost(Table table) { var blogPost = table.CreateInstance <BlogPost>(); var createBlogPostRequest = new WebRequestBuilder($"{ApiRootUrl}/blogPosts") .WithRequestMethod(HttpMethod.Post) .WithRequestData(blogPost) .Build(); _scenarioContext.PostRapidApiResponse = ApiRequestProcessor.Call(createBlogPostRequest); }
public void GivenIHaveAuthenticatedWithTheApplication() { var authEndpoint = "AUTH_ENDPOINT"; var clientId = "CLIENTID"; var clientSecret = "CLIENT_SECRET"; var url = $"{authEndpoint}?clientId={clientId}&clientSecret={clientSecret}"; var webRequest = new WebRequestBuilder(url) .Build(); _scenarioContext.AuthResponse = ApiRequestProcessor.Call(webRequest); }