From 15263e7d46b9b426a9f07e67f945ead709e17a16 Mon Sep 17 00:00:00 2001 From: David Tchepak Date: Sun, 13 Jul 2014 23:16:14 +1000 Subject: [PATCH] Adding test for #149 --- .../Issue149_ArgMatcherInReturns.cs | 24 +++++++++++++++++++ .../NSubstitute.Acceptance.Specs.csproj | 1 + 2 files changed, 25 insertions(+) create mode 100644 Source/NSubstitute.Acceptance.Specs/FieldReports/Issue149_ArgMatcherInReturns.cs diff --git a/Source/NSubstitute.Acceptance.Specs/FieldReports/Issue149_ArgMatcherInReturns.cs b/Source/NSubstitute.Acceptance.Specs/FieldReports/Issue149_ArgMatcherInReturns.cs new file mode 100644 index 000000000..9e5b063d8 --- /dev/null +++ b/Source/NSubstitute.Acceptance.Specs/FieldReports/Issue149_ArgMatcherInReturns.cs @@ -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(); + var sub2 = Substitute.For(); + sub1.GetItem(Arg.Any()).Returns(new Item()); + sub2.GetSignature(1).Returns(Arg.Any()); // <-- THIS IS THE PROBLEM + + sub1.GetItem("mystring"); + + sub1.ReceivedWithAnyArgs(1).GetItem("mystring"); + } + } +} \ No newline at end of file diff --git a/Source/NSubstitute.Acceptance.Specs/NSubstitute.Acceptance.Specs.csproj b/Source/NSubstitute.Acceptance.Specs/NSubstitute.Acceptance.Specs.csproj index 69e1ebcbe..33bd66bdb 100644 --- a/Source/NSubstitute.Acceptance.Specs/NSubstitute.Acceptance.Specs.csproj +++ b/Source/NSubstitute.Acceptance.Specs/NSubstitute.Acceptance.Specs.csproj @@ -99,6 +99,7 @@ +