Skip to content

Commit

Permalink
Adding test for #149
Browse files Browse the repository at this point in the history
  • Loading branch information
dtchepak committed Jul 13, 2014
1 parent 2357085 commit 15263e7
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
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");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
<Compile Include="AutoValuesForSubs.cs" />
<Compile Include="DynamicCalls.cs" />
<Compile Include="FieldReports\Issue129_AmbiguousArgsWithOutRef.cs" />
<Compile Include="FieldReports\Issue149_ArgMatcherInReturns.cs" />
<Compile Include="FieldReports\Issue75_DoesNotWorkWithMembersThatUseDynamic.cs" />
<Compile Include="PartialSubs.cs" />
<Compile Include="FieldReports\CallingIntoNewSubWithinReturns.cs" />
Expand Down

0 comments on commit 15263e7

Please sign in to comment.