Configuration

Configure The Scenario

So before we can start we need to configure our Scenario. To do this we are going to need provide a number of things.
1
var scenario = GrpcScenarioConfiguration
2
.UseGrpc<MyGrpcClient>()
3
.WithStoryBook<MyStoryBook, MyStoryData>()
4
.Configure(options =>
5
{
6
options.Services = _host.Services;
7
options.LogMessage = s => _output.WriteLine(s);
8
options.GrpcClient = c => new MyGrpcClient(c);
9
options.Client = _httpClient;
10
});
Copied!
    1.
    Line 2 we specify our grpc generated client.
    2.
    Line 3 we specify our StoryBook & Story Data
    3.
    Line 6 we provide an instance of our Service Provider so we can use dependency injection within our Stories (Optional)
    4.
    Line 7 we specify how to log our output (Recommended)
    5.
    Line 8 provides a delegate function to instantiate an instance of our gRPC client (Required)
    6.
    Line 9 provides an instance of our HTTP Client.
Last modified 1yr ago
Export as PDF
Copy link