C# Unit Test a StreamWriter parameter

前端 未结 3 532
梦谈多话
梦谈多话 2021-01-04 09:28

I have a bunch of classes that all implement an Interface and one of the parameters is a StreamWriter.

I need to check the contents of the StreamWriter.

I am

3条回答
  •  花落未央
    2021-01-04 09:56

    In that case you need to mock the test case. You can use frameworks likes rhino mocks. That advantage of mocking framework is, you can verify the contents of the objects, but you don't have to hit server or occupy server resources.

    This link will provide you the basic examples: http://www.codeproject.com/Articles/10719/Introducing-Rhino-Mocks

提交回复
热议问题