-
-
Notifications
You must be signed in to change notification settings - Fork 798
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
mock.Protected()
setup methods fail when argument is of type Expression
#1188
Milestone
Comments
@tonyhallett, could you please provide a minimal but complete repro (one including the declaration of |
public class FooBase
{
protected virtual ConstantExpression ExpressionProperty { get; set; }
}
public class Test {
[Fact]
public void This_Throws_But_Should_Not(){
var mock = new Mock<FooBase>();
var expression = Expression.Constant(1);
mock.Protected().SetupSet<Expression>("ExpressionProperty", expression);
}
} |
tonyhallett
added a commit
to tonyhallett/moq4
that referenced
this issue
Jul 22, 2021
stakx
changed the title
ProtectedMock fails when arguments are of type Expression
Jul 22, 2021
mock.Protected().SetupSet
fails when argument is of type Expression
tonyhallett
changed the title
Aug 2, 2021
mock.Protected().SetupSet
fails when argument is of type Expression
mock.Protected()
setup methods fails when argument is of type Expression
tonyhallett
changed the title
Aug 2, 2021
mock.Protected()
setup methods fails when argument is of type Expression
mock.Protected()
setup methods fail when argument is of type Expression
stakx
added a commit
that referenced
this issue
Aug 3, 2021
…n-type-args fix ProtectedMock fails when arguments are of type Expression #1188
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Throws
ToExpressionArg should check the Type and uses Expression.Constant if the argument type is a LambdaExpression / Expression
https://github.com/moq/moq4/blob/9e148f6955a2aef09c6e4a5c117c7c7deef0756e/src/Moq/Protected/ProtectedMock.cs#L520
The text was updated successfully, but these errors were encountered: