-
Notifications
You must be signed in to change notification settings - Fork 266
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
25 additions
and
0 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
Source/NSubstitute.Acceptance.Specs/FieldReports/Issue149_ArgMatcherInReturns.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using NUnit.Framework; | ||
|
||
namespace NSubstitute.Acceptance.Specs.FieldReports | ||
{ | ||
public class Issue149_ArgMatcherInReturns | ||
{ | ||
public interface ISub1 { Item GetItem(string s); } | ||
public interface ISub2 { string GetSignature(int i); } | ||
public class Item { } | ||
|
||
[Test] [Pending] [Ignore] | ||
public void MatcherInReturns() | ||
{ | ||
var sub1 = Substitute.For<ISub1>(); | ||
var sub2 = Substitute.For<ISub2>(); | ||
sub1.GetItem(Arg.Any<string>()).Returns(new Item()); | ||
sub2.GetSignature(1).Returns(Arg.Any<string>()); // <-- THIS IS THE PROBLEM | ||
|
||
sub1.GetItem("mystring"); | ||
|
||
sub1.ReceivedWithAnyArgs(1).GetItem("mystring"); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters