🃏
Bard
  • Introduction
  • Getting Started
    • Installation
    • Writing Your First Test
    • Configuration
    • .NET Fiddles
  • Anatomy Of A Scenario
    • Given
      • StoryData
      • StoryBook
      • Chapter
      • Story
    • When
    • Then
      • HTTP Response
      • Headers
      • Bad Requests
      • Performance Testing
  • Advanced
    • Dependency Injection
  • Miscellaneous
    • Change Log
    • Migration Guide
  • gRPC
    • Installation
    • Configuration
    • Writing A Test
  • Tips & Tricks
    • FAQ
Powered by GitBook
On this page

Was this helpful?

Export as PDF
  1. gRPC

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.

 var scenario = GrpcScenarioConfiguration
                .UseGrpc<MyGrpcClient>()
                .WithStoryBook<MyStoryBook, MyStoryData>()
                .Configure(options =>
                {
                    options.Services = _host.Services;
                    options.LogMessage = s => _output.WriteLine(s);
                    options.GrpcClient = c => new MyGrpcClient(c);
                    options.Client = _httpClient;
                });
  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.

PreviousInstallationNextWriting A Test

Last updated 4 years ago

Was this helpful?