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
The GetMock() method has a default value of MockBehavior.Default but the problem is that in this enumerable, MockBehavior.Default and MockBehavior.Loose have the exact same value.
From Moq sources:
public enum MockBehavior
{
Strict,
Loose,
Default = Loose,
}
So when the default behavior is MockBehavior.Strict and you call GetMock(MockBehavior.Loose) it's the same as calling GetMock(MockBehavior.Default) and it ends up creating a strict mock (which is the default), instead of a loose mock as requested.
The text was updated successfully, but these errors were encountered:
On Wed, May 16, 2018 at 12:09 PM, blinxsweeper ***@***.***> wrote:
The GetMock() method has a default value of MockBehavior.Default but the
problem is that in this enumerable, MockBehavior.Default and
MockBehavior.Loose have the exact same value.
*From Moq sources:*
public enum MockBehavior
{
Strict,
Loose,
Default = Loose,
}
So when the default behavior is MockBehavior.Strict and you call
GetMock(MockBehavior.Loose) it's the same as calling
GetMock(MockBehavior.Default) and it ends up creating a strict mock (which
is the default), instead of a loose mock as requested.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#42>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/ATn468YgScRdX6aHDMcsg5S2qQZhE3Klks5ty6Z1gaJpZM4UAnh4>
.
The GetMock() method has a default value of MockBehavior.Default but the problem is that in this enumerable, MockBehavior.Default and MockBehavior.Loose have the exact same value.
From Moq sources:
public enum MockBehavior
{
Strict,
Loose,
Default = Loose,
}
So when the default behavior is MockBehavior.Strict and you call GetMock(MockBehavior.Loose) it's the same as calling GetMock(MockBehavior.Default) and it ends up creating a strict mock (which is the default), instead of a loose mock as requested.
The text was updated successfully, but these errors were encountered: