Rhino Mocks 2.8.4 – A Rough Diamond

time to read 1 min | 162 words

Well, it has been 24 hours, what did you expect?

This release fixes a bug in creating Multi Mocks. When a MultiMock was requested, and it implemented a non virtual method and one of the extended interfaces also had the same method, an exception would be thrown. This one was fun to dig into, actually.

The problem was in the CLR method table, and the way Dynamic Proxy handles generating new methods. By default, it always generated virtual methods, which caused a type load exception if the base type had that method marked as non virtual. The solution was to check for the existence of such methods, and then generate any additional methods with the same signature with new slots in the method table.

Ten points for the first commenter who will tell me what I meant with the title, and how it relates to the problem at hand.

At any rate, you can find the new release here, in both binary and source formats.