Łukasz Podolak
2008-08-13 14:29:24 UTC
Hello,
I have an abstract class with two constructors:
public abstract class MyClass
{
protected internal MyClass() : this(GetConfiguration())
{
....
}
internal MyClass(IConfiguration configuration)
{
....
}
}
I want to mock it, but calling the constructor with one parameter.
But, the code:
var sutMyClass = mocks.Stub<MyClass>(new object[]{new
Configuration()});
throws:
System.MissingMethodException: Constructor on type
'MyClassProxy8e791bf4db1c4a8ab8074abd6c8727a7' not found.
I'm running tests with nunit and Rhino Mocks 3.5. Test assembly is
pointed with "InternalsVisibleTo" from main assembly, so the internal
constructor should be visible, but is not.
Where am I wrong?
thanks,
Łukasz Podolak
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Rhino.Mocks" group.
To post to this group, send email to ***@googlegroups.com
To unsubscribe from this group, send email to RhinoMocks+***@googlegroups.com
For more options, visit this group at http://groups.google.com/group/RhinoMocks?hl=en
-~----------~----~----~----~------~----~------~--~---
I have an abstract class with two constructors:
public abstract class MyClass
{
protected internal MyClass() : this(GetConfiguration())
{
....
}
internal MyClass(IConfiguration configuration)
{
....
}
}
I want to mock it, but calling the constructor with one parameter.
But, the code:
var sutMyClass = mocks.Stub<MyClass>(new object[]{new
Configuration()});
throws:
System.MissingMethodException: Constructor on type
'MyClassProxy8e791bf4db1c4a8ab8074abd6c8727a7' not found.
I'm running tests with nunit and Rhino Mocks 3.5. Test assembly is
pointed with "InternalsVisibleTo" from main assembly, so the internal
constructor should be visible, but is not.
Where am I wrong?
thanks,
Łukasz Podolak
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Rhino.Mocks" group.
To post to this group, send email to ***@googlegroups.com
To unsubscribe from this group, send email to RhinoMocks+***@googlegroups.com
For more options, visit this group at http://groups.google.com/group/RhinoMocks?hl=en
-~----------~----~----~----~------~----~------~--~---