Does it work when you try: SomeClass c = MockRepository.CreateMock<SomeClass>(a, b);
On Wed, Jun 17, 2009 at 9:39 PM, [email protected] <[email protected]>wrote: > > Hi, > > I'm trying to mock a class that doesn't have a default constructor > (i.e. it has been 'overidden' by a custom constructor which is > parameterized) which - according to the wiki (http://ayende.com/wiki/ > Rhino%20Mocks%20Mocking%20classes.ashx) - should be possible. There > isn't anything particularly special about what I'm trying to do, > simply something like the following: > > public class SomeClass > { > public SomeClass(A a, B b) > { ... } > > virtual public string SomeMethod() > { ... } > } > > > [Test] > public void SomeTest() > { > SomeClass c = MockRepository.CreateMock<SomeClass>(); > ... > } > > NUnit reports the following error: > > System.MissingMethodException : Can't find a constructor with matching > arguments > ----> System.MissingMethodException : Constructor on type > 'SomeClass207ade2ffbbc4e7cba459d96ac172bb9' not found. > > cheers! > > > -- Chris Missal http://chrismissal.lostechies.com/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Rhino.Mocks" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/RhinoMocks?hl=en -~----------~----~----~----~------~----~------~--~---
