I want to test my network stream input & outputs and I'm using TlsStream<TcpStream> wrapper on my raw TcpStream, but I couldn't find a way to create a mock TlsStream struct.
For regular TcpStream, if I just make function parameter mut stream: TcpStream to -> mut stream: impl Read + Write + Unpin I can put my custom MockTcpStream here to test reads & writes.
(like here: https://rust-lang.github.io/async-book/09_example/03_tests.html)
How can I create an TlsStream mock to test my network communication? To see which inputs gives which outputs?
Hello!
I want to test my network stream input & outputs and I'm using
TlsStream<TcpStream>
wrapper on my rawTcpStream
, but I couldn't find a way to create a mockTlsStream
struct.For regular TcpStream, if I just make function parameter
mut stream: TcpStream
to ->mut stream: impl Read + Write + Unpin
I can put my customMockTcpStream
here to test reads & writes. (like here: https://rust-lang.github.io/async-book/09_example/03_tests.html)How can I create an TlsStream mock to test my network communication? To see which inputs gives which outputs?
Thanks!