How to moq a NetworkStream in a unit test?

后端 未结 3 584
滥情空心
滥情空心 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:16

    Put the NetworkStream behind a simple interface (with only the calls you need) and mock that.

提交回复
热议问题