When's the next release & SetMatcher woes

Help
2006-08-28
2013-03-22
  • Does anyone have a rough idea when the next release will be?

    In the meantime, I'm having difficulty setting custom matchers.  Here's an example of the code I use to set the matcher?

    control.ExpectAndReturn(mock.DoSomething(param), returnObject);
    control.SetMatcher(new CustomerMatcher());

    I'm getting an EasyMockNET.Utils.IllegalStateException, saying the matcher has already been set.

    The only way I've been able to set matchers in the past is with SetDefaultMatcher, but I'm at a point now where I need the default matcher to be maintained and I need to set this custom matcher for this one call.  Any ideas?

     
    • Ok, I realized I had to go old school with the expect and return by
      1) calling the method
      2) setting the matcher
      3) setting the return value.

      I updated our source to except a matcher in the ExpectAndReturn methods.

      Any ETA on the next release?

       
      • Jon Skeet
        Jon Skeet
        2006-08-29

        Good question. I have the source for a version with various improvements, but no documentation for it. I also don't have experience in producing a new version :)

        Unfortunately I'm no longer working with C# professionally, and I have young twins, so time is at a bit of a premium. If people are happy to experiment a bit, I could put the source code in and release it as an alpha... I'm pretty sure the code is okay (we've been using it at work), it's just the docs which are missing. Having said that, there are much better Intellisense docs than there used to be...

        The code I've got *isn't* backward-compatible with the previous version, however - various things have changed to make it more appropriately .NET rather than showing the Java roots.

        I have to say that I have no plans to take this any further at the moment. There are other mocking frameworks which I believe *are* active - one I keep meaning to investigate is RhinoMocks, which sounds like it has the same sort of model as EasyMock.NET.

        Jon

         
    • RhinoMocks is a great framework, and I'm pushing everyone at work to adopt it.  Most of our existings tests use EasyMock though, and it's used by several helper classes as well.  It's nice to know that it's basically dead.  I won't feel bad about tweaking it for our needs until we've phased it out.

      Thanks for your quick reply Jon, and have fun with the twins.

      Drew

       
      • Jon Skeet
        Jon Skeet
        2006-08-30

        You certainly shouldn't feel bad about tweaking it :) It's good to know that RhinoMocks is good - I haven't had a chance to look at it carefully yet.

        Just shout if you want my most recent EasyMock.NET code, which may avoid you having to tweak it as much (in terms of a few fixed bugs).

        Jon