How to moq a NetworkStream in a unit test?

后端 未结 3 581
滥情空心
滥情空心 2020-12-15 20:53

I\'m using Moq & NUnit as a unit test framework.

I\'ve written a method that is given a NetworkStream object as a parameter:

public static void R         


        
3条回答
  •  情深已故
    2020-12-15 21:38

    As suggested in the comments - is it possible for you to change the type to Stream, so that you, during testing, can pass a MemoryStream instead?

提交回复
热议问题