How can I mock grpc server for tests? I have 2 microservices and from one of them i send request through gprc to second one. I have overwrited AfterAddApplication. This works but the request is sent to real service and of couse i got exception.
protected override void AfterAddApplication(IServiceCollection services)
{
_client = Substitute.For<MyClass>();
var responce = AsyncUnaryCall<SomeClass>(); //responce with real value
_client.GetAllAsync(Arg.Any<Request>()).Returns(responce);
services.AddSingleton(_client);
}