You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
throws exception
System.InvalidOperationException
HResult=0x80131509
Message=Sequence contains more than one matching element
Source=System.Core
StackTrace:
at System.Linq.Enumerable.SingleOrDefault[TSource](IEnumerable1 source, Func2 predicate)
at Moq.ExpressionExtensions.GetReboundProperty(MemberExpression expression) in C:\projects\moq4\src\Moq\ExpressionExtensions.cs:line 365
at Moq.ExpressionExtensions.g__Split|5_0(Expression e, Expression& r, InvocationShape& p, Boolean assignment, Boolean allowNonOverridableLastProperty) in C:\projects\moq4\src\Moq\ExpressionExtensions.cs:line 310
at Moq.ExpressionExtensions.Split(LambdaExpression expression, Boolean allowNonOverridableLastProperty) in C:\projects\moq4\src\Moq\ExpressionExtensions.cs:line 149
at Moq.Mock.Setup(Mock mock, LambdaExpression expression, Condition condition) in C:\projects\moq4\src\Moq\Mock.cs:line 505
at Moq.Mock1.Setup[TResult](Expression1 expression) in C:\projects\moq4\src\Moq\Mock`1.cs:line 455
at ConsoleApp1.Program.Main(String[] args) in C:\SandBox\MoqTests\ConsoleApp1\Program.cs:line 14
This exception was originally thrown at this call stack:
System.Linq.Enumerable.SingleOrDefault(System.Collections.Generic.IEnumerable, System.Func<TSource, bool>)
Moq.ExpressionExtensions.GetReboundProperty(System.Linq.Expressions.MemberExpression) in ExpressionExtensions.cs
Moq.ExpressionExtensions.Split.__Split|5_0(System.Linq.Expressions.Expression, out System.Linq.Expressions.Expression, out Moq.InvocationShape, bool, bool) in ExpressionExtensions.cs
Moq.ExpressionExtensions.Split(System.Linq.Expressions.LambdaExpression, bool) in ExpressionExtensions.cs
Moq.Mock.Setup(Moq.Mock, System.Linq.Expressions.LambdaExpression, Moq.Condition) in Mock.cs
Moq.Mock.Setup(System.Linq.Expressions.Expression<System.Func<T, TResult>>) in Mock`1.cs
vb.Net code:
C# code:
throws exception
System.InvalidOperationException
HResult=0x80131509
Message=Sequence contains more than one matching element
Source=System.Core
StackTrace:
at System.Linq.Enumerable.SingleOrDefault[TSource](IEnumerable
1 source, Func
2 predicate)at Moq.ExpressionExtensions.GetReboundProperty(MemberExpression expression) in C:\projects\moq4\src\Moq\ExpressionExtensions.cs:line 365
at Moq.ExpressionExtensions.g__Split|5_0(Expression e, Expression& r, InvocationShape& p, Boolean assignment, Boolean allowNonOverridableLastProperty) in C:\projects\moq4\src\Moq\ExpressionExtensions.cs:line 310
at Moq.ExpressionExtensions.Split(LambdaExpression expression, Boolean allowNonOverridableLastProperty) in C:\projects\moq4\src\Moq\ExpressionExtensions.cs:line 149
at Moq.Mock.Setup(Mock mock, LambdaExpression expression, Condition condition) in C:\projects\moq4\src\Moq\Mock.cs:line 505
at Moq.Mock
1.Setup[TResult](Expression
1 expression) in C:\projects\moq4\src\Moq\Mock`1.cs:line 455at ConsoleApp1.Program.Main(String[] args) in C:\SandBox\MoqTests\ConsoleApp1\Program.cs:line 14
This exception was originally thrown at this call stack:
System.Linq.Enumerable.SingleOrDefault(System.Collections.Generic.IEnumerable, System.Func<TSource, bool>)
Moq.ExpressionExtensions.GetReboundProperty(System.Linq.Expressions.MemberExpression) in ExpressionExtensions.cs
Moq.ExpressionExtensions.Split.__Split|5_0(System.Linq.Expressions.Expression, out System.Linq.Expressions.Expression, out Moq.InvocationShape, bool, bool) in ExpressionExtensions.cs
Moq.ExpressionExtensions.Split(System.Linq.Expressions.LambdaExpression, bool) in ExpressionExtensions.cs
Moq.Mock.Setup(Moq.Mock, System.Linq.Expressions.LambdaExpression, Moq.Condition) in Mock.cs
Moq.Mock.Setup(System.Linq.Expressions.Expression<System.Func<T, TResult>>) in Mock`1.cs
code
does not throw exception
The text was updated successfully, but these errors were encountered: