Hi Christopher,
Thank you for your response, I had a feeling that this is the way that it should be approached. In my case the RPC is fairly straight forward, but I’d still like it to be testable, so perhaps using DataFlow blocks as you have is suitable. I’ll look into it thanks.
class MockClientRequestStream<T> : IAsyncStreamReader<T>
{
private readonly IEnumerator<T> _enumerator;
public MockClientRequestStream(IEnumerable<T> data)
{
_enumerator = data.GetEnumerator();
}
public void Dispose()
{
_enumerator.Dispose();
}
public Task<bool> MoveNext(CancellationToken cancellationToken)
{
return Task.FromResult(_enumerator.MoveNext());
}
public T Current => _enumerator.Current;
}