Class TestCalls
Test doubles for client-side call objects.
Inheritance
System.Object
TestCalls
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Grpc.Core.Testing
Assembly: Grpc.Core.Testing.dll
Syntax
public static class TestCalls
Methods
AsyncClientStreamingCall<TRequest, TResponse>(IClientStreamWriter<TRequest>, Task<TResponse>, Task<Metadata>, Func<Status>, Func<Metadata>, Action)
Creates a test double for AsyncClientStreamingCall
. Only for testing.
Note: experimental API that can change or be removed without any prior notice.
Declaration
public static AsyncClientStreamingCall<TRequest, TResponse> AsyncClientStreamingCall<TRequest, TResponse>(IClientStreamWriter<TRequest> requestStream, Task<TResponse> responseAsync, Task<Metadata> responseHeadersAsync, Func<Status> getStatusFunc, Func<Metadata> getTrailersFunc, Action disposeAction)
Parameters
Type | Name | Description |
---|---|---|
IClientStreamWriter<TRequest> | requestStream | |
System.Threading.Tasks.Task<TResponse> | responseAsync | |
System.Threading.Tasks.Task<Metadata> | responseHeadersAsync | |
System.Func<Status> | getStatusFunc | |
System.Func<Metadata> | getTrailersFunc | |
System.Action | disposeAction |
Returns
Type | Description |
---|---|
AsyncClientStreamingCall<TRequest, TResponse> |
Type Parameters
Name | Description |
---|---|
TRequest | |
TResponse |
AsyncDuplexStreamingCall<TRequest, TResponse>(IClientStreamWriter<TRequest>, IAsyncStreamReader<TResponse>, Task<Metadata>, Func<Status>, Func<Metadata>, Action)
Creates a test double for AsyncDuplexStreamingCall
. Only for testing.
Note: experimental API that can change or be removed without any prior notice.
Declaration
public static AsyncDuplexStreamingCall<TRequest, TResponse> AsyncDuplexStreamingCall<TRequest, TResponse>(IClientStreamWriter<TRequest> requestStream, IAsyncStreamReader<TResponse> responseStream, Task<Metadata> responseHeadersAsync, Func<Status> getStatusFunc, Func<Metadata> getTrailersFunc, Action disposeAction)
Parameters
Type | Name | Description |
---|---|---|
IClientStreamWriter<TRequest> | requestStream | |
IAsyncStreamReader<TResponse> | responseStream | |
System.Threading.Tasks.Task<Metadata> | responseHeadersAsync | |
System.Func<Status> | getStatusFunc | |
System.Func<Metadata> | getTrailersFunc | |
System.Action | disposeAction |
Returns
Type | Description |
---|---|
AsyncDuplexStreamingCall<TRequest, TResponse> |
Type Parameters
Name | Description |
---|---|
TRequest | |
TResponse |
AsyncServerStreamingCall<TResponse>(IAsyncStreamReader<TResponse>, Task<Metadata>, Func<Status>, Func<Metadata>, Action)
Creates a test double for AsyncServerStreamingCall
. Only for testing.
Note: experimental API that can change or be removed without any prior notice.
Declaration
public static AsyncServerStreamingCall<TResponse> AsyncServerStreamingCall<TResponse>(IAsyncStreamReader<TResponse> responseStream, Task<Metadata> responseHeadersAsync, Func<Status> getStatusFunc, Func<Metadata> getTrailersFunc, Action disposeAction)
Parameters
Type | Name | Description |
---|---|---|
IAsyncStreamReader<TResponse> | responseStream | |
System.Threading.Tasks.Task<Metadata> | responseHeadersAsync | |
System.Func<Status> | getStatusFunc | |
System.Func<Metadata> | getTrailersFunc | |
System.Action | disposeAction |
Returns
Type | Description |
---|---|
AsyncServerStreamingCall<TResponse> |
Type Parameters
Name | Description |
---|---|
TResponse |
AsyncUnaryCall<TResponse>(Task<TResponse>, Task<Metadata>, Func<Status>, Func<Metadata>, Action)
Creates a test double for AsyncUnaryCall
. Only for testing.
Note: experimental API that can change or be removed without any prior notice.
Declaration
public static AsyncUnaryCall<TResponse> AsyncUnaryCall<TResponse>(Task<TResponse> responseAsync, Task<Metadata> responseHeadersAsync, Func<Status> getStatusFunc, Func<Metadata> getTrailersFunc, Action disposeAction)
Parameters
Type | Name | Description |
---|---|---|
System.Threading.Tasks.Task<TResponse> | responseAsync | |
System.Threading.Tasks.Task<Metadata> | responseHeadersAsync | |
System.Func<Status> | getStatusFunc | |
System.Func<Metadata> | getTrailersFunc | |
System.Action | disposeAction |
Returns
Type | Description |
---|---|
AsyncUnaryCall<TResponse> |
Type Parameters
Name | Description |
---|---|
TResponse |