开发者

How to mock arbitrary behavior with Rhino Mocks?

开发者 https://www.devze.com 2023-01-14 11:53 出处:网络
I\'m trying to mock a data layer method. The method takes a string and two lists as arguments, and the method populates those lists from the results of a stored proc. Also, I\'m still on C# 2.0 with V

I'm trying to mock a data layer method. The method takes a string and two lists as arguments, and the method populates those lists from the results of a stored proc. Also, I'm still on C# 2.0 with VS2005, and I'm using Rhino Mocks 3.5 for .NET 2.0. If possible, it would be nice to use the AAA format.

So yeah, all I 开发者_Python百科want to do is mock an interface method that will add a couple of fake objects to the argument lists and return. Unfortunately, after reading the Rhino Mocks documentation, I have little to no idea how to do this. Rhino is a unintelligible puzzle box to me and I'm powerless to do anything without examples; examples that I can't find.

Anyone have any idea how I can do this?


You can use the AAA syntax with .NET 2.0, it's just a little bit more typing. See Using the AAA syntax in C# 2.0

0

精彩评论

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

关注公众号