예제 #1
0
        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);
        }
예제 #2
0
        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);
        }
예제 #3
0
        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);
        }