From: Choy R. <ch...@rc...> - 2004-12-30 00:22:43
|
Griffin, I've coded the support for expectations that modify ref/out parameters in branch RFE_1001778. The changes are ready for your review. I'm itching to do a bit more refactoring, like eliminating the redundancies between DynamicMockTests and DynamicOrderedMockTests. But most of the refactorings I have in mind can wait until I merge this branch with the trunk. I've added two unit tests to DynamicMockTests (unit tests were also added for the class generator code) which show how to use the feature. I'll explain some of the basics here. Let's say we have a method that takes a ref parameter: void Increment(ref int index); We can specify our expectation like so: mock.Expect("Increment", new Assign(2).AndRequire(new IsEqual(1)) ); That expectation will check the predicate first, then assign 2 to the ref parameter. Take a look and let me know what you think. When you bless it, I'll merge it into the trunk. --Choy p.s. I'm still wondering about the license and the commit emails . :-P |