Skip to content

Quick Start

Yauhen Shayunou edited this page Oct 21, 2020 · 1 revision

This page contains instruction required to install and configure GodelTech.StoryLine and test REST service.

Install NuGet packages

Two NuGet packages needs to be installed in order to implement test scenarios for REST service:

  1. GodelTech.StoryLine package which contains core functionality of framework.
  2. GodelTech.StoryLine.Rest package which contains REST-specific actions and expectations.

Set global settings

GodelTech.StoryLine package doesn't require any configuration. The only configuration is required for GodelTech.StoryLine.Rest. The following lines must be executed once for your test pack execution.

GodelTech.StoryLine.Rest.Config.AddServiceEndpont("MyService", "http://localhost:1234/");
GodelTech.StoryLine.Rest.Config.SetAssemblies(typeof(Config).GetTypeInfo().Assembly);

If you are using NUnit this code can be placed in class decorated with SetUpFixture attribute. If XUnit is used this code can be located in passed as parameter to ICollectionFixture<T> implementation.

You may find detailed information regarding GodelTech.StoryLine.Rest on the following page.

Add test scenario

Put the following lines inside you test case (e.g. method decorated either with Test or Fact attributes).

Scenario.New()
    .When()
        .Performs<HttpRequest>(x => x
            .Method("GET")
            .Url("/swagger/v1/swagger.json"))
    .Then()
        .Expects<HttpResponse>(x => x
            .Status(HttpStatusCode.OK))
    .Run();

Clone this wiki locally