Has anyone successfully mocked the Socket class in .NET?

后端 未结 5 1070
深忆病人
深忆病人 2021-01-02 08:38

I\'m trying to mock out the System.net.Sockets.Socket class in C# - I tried using NUnit mocks but it can\'t mock concrete classes. I also tried using Rhino Mocks but it see

5条回答
  •  北荒
    北荒 (楼主)
    2021-01-02 08:52

    I've created an example console application using the method thinkzig suggests (an adapter class for Socket). It uses RhinoMocks and NUnit. You can download it here: How to mock System.Net.Sockets.Socket.

提交回复
热议问题