I have a method in my business logic layer that accepts a stream, which in the GUI comes from a user uploading a file, and I am interested in which is an appropriate way to test that the method appropriately uses this stream to make decisions.
public Sub Initialize(ByVal uploadStream As Stream)
''// Logic using uploadStream
End Sub
For testing purposes I wish to DI a mocked stream into this method, but I find a stiffling lack of abstraction whenever working with streams.
Intuition tells me that a need to create a Stream wrapper which would allow me to DI an interface of the wrapper to test interaction of my logic with the stream wapper.
What's the best way to proceed?