开发者

Mocking classes in Rhino Mocks

开发者 https://www.devze.com 2023-03-09 17:16 出处:网络
Lets say there is an Interface ICreateFileStrategy. Lets say there are classes A and B that implement these two interfaces. Both these classes implement method

Lets say there is an Interface ICreateFileStrategy. Lets say there are classes A and B that implement these two interfaces. Both these classes implement method

long CreateFile(ExportFile exportFile)

Now w开发者_运维知识库hen I want to write a unit test I want to test method CreateFile of class A. How is this possible. How do I set the expectations exactly.

Thanks, Sai


for starters you test the class not the interface, so you just create an instance of Class A mock all of the dependencies and then test the method

0

精彩评论

暂无评论...
验证码 换一张
取 消