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
vartypeMock=Substitute.For<Type>();vartypeFormatterMock=Substitute.For<ITypeFormatter>();typeFormatterMock.GetPrettyTypeName(typeMock).Returns("pretty name");varresult=typeFormatterMock.GetPrettyTypeName(typeMock);Debug.Assert(!string.IsNullOrEmpty(result),"Result should not be null or empty.");
Expected behaviour
I would expect for result variable to not be empty and it's value be exactly pretty name just the way I configured the call.
When I use Arg.Any<Type>() instead of typeMock in call setup, it works.
Using Arg.Is(typeMock) does not help.
Environment:
NSubstitute version: 5.3.0
Platform: .NET 8.0 project on Windows
The text was updated successfully, but these errors were encountered:
Describe the bug
A substitute on
Type
instance seems to be not recognized properly when used to setup method call.To Reproduce
Interface:
Test code:
Expected behaviour
I would expect for
result
variable to not be empty and it's value be exactlypretty name
just the way I configured the call.When I use
Arg.Any<Type>()
instead oftypeMock
in call setup, it works.Using
Arg.Is(typeMock)
does not help.Environment:
The text was updated successfully, but these errors were encountered: