Skip to content
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

Stack overflow when setting up mock with default value set to mock. #163

Closed
psmolinsky opened this issue Mar 20, 2015 · 0 comments
Closed

Comments

@psmolinsky
Copy link

Following code used to work in 4.2.1409.1722, but does not in 4.2.1502.0911. It throw a StackOverflowException. Please fix it. This looks similar to #161

var httpContext = new Mock<HttpContextBase> { DefaultValue = DefaultValue.Mock };
httpContext.SetupGet(c => c.Request.Cookies).Returns(new HttpCookieCollection());
vladonemo added a commit to vladonemo/moq4 that referenced this issue Jan 29, 2016
vladonemo added a commit to vladonemo/moq4 that referenced this issue May 12, 2016
kzu pushed a commit that referenced this issue Aug 10, 2016
@stakx stakx closed this as completed Jun 5, 2017
stakx added a commit to stakx/moq that referenced this issue Jun 11, 2017
`SerializableTypesValueProvider` is supposed to work around Castle
DynamicProxy refusing to proxy classes that implement ISerializable
incorrectly. In such cases, Moq is supposed to just fall back to
the empty default value provider, even when a mock has been set up
to use the mock default value provider.

The problem was mentioned in GitHub issue devlooped#163, and there was even
a test demonstrating how Moq previously propagated DynamicProxy's
exception. A fix was then added to Moq, but no tests. This commit
adds some. Better late than never.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants