Enhanced.Testing.Component.GrpcClient
1.4.0
See the version list below for details.
dotnet add package Enhanced.Testing.Component.GrpcClient --version 1.4.0
NuGet\Install-Package Enhanced.Testing.Component.GrpcClient -Version 1.4.0
<PackageReference Include="Enhanced.Testing.Component.GrpcClient" Version="1.4.0" />
<PackageVersion Include="Enhanced.Testing.Component.GrpcClient" Version="1.4.0" />
<PackageReference Include="Enhanced.Testing.Component.GrpcClient" />
paket add Enhanced.Testing.Component.GrpcClient --version 1.4.0
#r "nuget: Enhanced.Testing.Component.GrpcClient, 1.4.0"
#:package Enhanced.Testing.Component.GrpcClient@1.4.0
#addin nuget:?package=Enhanced.Testing.Component.GrpcClient&version=1.4.0
#tool nuget:?package=Enhanced.Testing.Component.GrpcClient&version=1.4.0
Enhanced.Testing.Component.GrpcClient
A gRPC client harness for Enhanced.Testing.Component:
creates generated gRPC clients that call the application in memory through TestServer, without opening network
ports.
dotnet add package Enhanced.Testing.Component.GrpcClient
Usage
var grpc = new GrpcClientHarness();
var component = ComponentBuilder.Create<Program>()
.AddHarness(grpc)
.Build();
In a test, create any client generated from your .proto files:
var client = grpc.CreateClient<Greeter.GreeterClient>();
var reply = await client.SayHelloAsync(new HelloRequest { Name = "John" });
Assert.Equal("Hello John", reply.Message);
The harness creates one channel per client type and shuts the channels down when the component stops.
Generate the client from the same .proto file as the service, for example in the test project (code generation
needs the Grpc.Tools and Google.Protobuf packages, or Grpc.AspNetCore, which includes both):
<ItemGroup>
<Protobuf Include="..\MyService\Protos\greet.proto" GrpcServices="Client" />
</ItemGroup>
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. net11.0 is compatible. |
-
net10.0
- Enhanced.Testing.Component (>= 1.4.0)
- Grpc.Net.Client (>= 2.85.0)
-
net11.0
- Enhanced.Testing.Component (>= 1.4.0)
- Grpc.Net.Client (>= 2.85.0)
-
net8.0
- Enhanced.Testing.Component (>= 1.4.0)
- Grpc.Net.Client (>= 2.85.0)
-
net9.0
- Enhanced.Testing.Component (>= 1.4.0)
- Grpc.Net.Client (>= 2.85.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.