-
Notifications
You must be signed in to change notification settings - Fork 268
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
System.TypeLoadException with EfficientDynamoDb IUpdateEntityRequestBuilder<TEntity> #866
Comments
Could you please post the full exception details included the innerexceptions? |
@304NotModified - sure.
|
Do you know if this works in Moq? Because I'm doubting if this a NSubstitute or Castle.Core issue |
@304NotModified with Moq I get:
|
Does this mean that I cannot mock this interface at all? |
Not sure, it could be a bug in Castle.Core Could you try to reproduce it with your own interface and make the interface as minimal as possible? |
@304NotModified - It all seems to stem from having an |
Thanks for this nice small reproduction example! :) I doubting about the next step. I guess we should ask this at https://github.com/castleproject/Core? |
@304NotModified - do you have advice on how I raise that with the Castle Project? Are they going to work OK with my example? Or are they going to need a lower level investigation? |
Hi @baynezy I tested your great example. I've noticed with even a smaller interface it's an issue. This is OK public interface IExample
{
bool Check();
} This fails public interface IExampleWithInternal
{
internal bool Check();
} |
Thanks @304NotModified - I have merged that. Did you have any thoughts on the best way to raise that with https://github.com/castleproject/Core ? |
I searched for a related issue, but have found one. So I guess we have create a new issue and ask if internal methods in interfaces are supported. Unfortunately I don't know if this a issue by Moq/NSub or Castle.Core. |
@baynezy Are you creating a new GitHub issue on https://github.com/castleproject/Core? |
@baynezy FWIW there's no way Castle.Core could create an implementation of this interface. As you stated, the |
Describe the bug
I am trying to create a mock of
IUpdateEntityRequestBuilder<TEntity>
. When I do this I get aSystem.TypeLoadException
To Reproduce
EfficientDynamoDb
via NuGetIUpdateEntityRequestBuilder<TEntity>
. E.g.var builderMock = Substitute.For<IUpdateEntityRequestBuilder<object>>();
Please make sure you are using NSubstitute.Analyzers and that it does not pick up any problems with the reproduction code. The analyzers can help detect the cause of many issues.
Expected behaviour
I expect that the mock would be created successfully.
Environment:
Additional context
Is this because
IUpdateEntityRequestBuilder<TEntity>
extendsIUpdateItemBuilder<IUpdateEntityRequestBuilder<TEntity>>
which has an internal method?The text was updated successfully, but these errors were encountered: