diff --git a/Source/NSubstitute.Specs/CallFormatterSpecs.cs b/Source/NSubstitute.Specs/CallFormatterSpecs.cs index fb7665e76..b9fbed1f8 100644 --- a/Source/NSubstitute.Specs/CallFormatterSpecs.cs +++ b/Source/NSubstitute.Specs/CallFormatterSpecs.cs @@ -82,15 +82,10 @@ public override CallFormatter CreateSubjectUnderTest() } private void AssertCallFormat(Action callOnSubstitute, string expectedFormat) - { - AssertCallFormat(callOnSubstitute, new int[0], expectedFormat); - } - - private void AssertCallFormat(Action callOnSubstitute, IEnumerable argumentsToHighlight, string expectedFormat) { callOnSubstitute(_sampleSub); var call = _sampleSub.ReceivedCalls().First(); - var format = sut.Format(call.GetMethodInfo(), call.GetArguments(), argumentsToHighlight); + var format = sut.Format(call.GetMethodInfo(), call.GetArguments(), new ArgumentMatchInfo[0]); Assert.That(format, Is.EqualTo(expectedFormat)); } diff --git a/Source/NSubstitute.Specs/CallSpecificationSpecs.cs b/Source/NSubstitute.Specs/CallSpecificationSpecs.cs index 4e016ee0e..c7a5429fe 100644 --- a/Source/NSubstitute.Specs/CallSpecificationSpecs.cs +++ b/Source/NSubstitute.Specs/CallSpecificationSpecs.cs @@ -141,7 +141,9 @@ public override void Context() { base.Context(); _callFormatter = mock(); - _callFormatter.stub(x => x.Format(_methodInfoSpecified, new[] { _firstArgSpec, _secondArgSpec }, new int[0])).Return(FormattedCall); + _callFormatter + .stub(x => x.Format(_methodInfoSpecified, new[] { _firstArgSpec, _secondArgSpec }, new ArgumentMatchInfo[0])) + .Return(FormattedCall); } public override void Because() diff --git a/Source/NSubstitute/Core/CallFormatter.cs b/Source/NSubstitute/Core/CallFormatter.cs index 0fd6871cc..9b7f65886 100644 --- a/Source/NSubstitute/Core/CallFormatter.cs +++ b/Source/NSubstitute/Core/CallFormatter.cs @@ -20,14 +20,14 @@ public CallFormatter(IArgumentsFormatter argumentsFormatter) public string Format(ICall call, ICallSpecification withRespectToCallSpec) { - return Format(call.GetMethodInfo(), call.GetArguments(), withRespectToCallSpec.NonMatchingArguments(call).Select(x=> x.Index)); + return Format(call.GetMethodInfo(), call.GetArguments(), withRespectToCallSpec.NonMatchingArguments(call)); } - public string Format(MethodInfo methodInfoOfCall, IEnumerable arguments, IEnumerable argumentsToHighlight) + public string Format(MethodInfo methodInfoOfCall, IEnumerable arguments, IEnumerable nonMatchingArguments) { return _methodInfoFormatters .First(x => x.CanFormat(methodInfoOfCall)) - .Format(methodInfoOfCall, arguments, argumentsToHighlight); + .Format(methodInfoOfCall, arguments, nonMatchingArguments.Select(x => x.Index)); } } } \ No newline at end of file diff --git a/Source/NSubstitute/Core/CallSpecification.cs b/Source/NSubstitute/Core/CallSpecification.cs index 6f3e41ad8..7d41158f0 100644 --- a/Source/NSubstitute/Core/CallSpecification.cs +++ b/Source/NSubstitute/Core/CallSpecification.cs @@ -27,7 +27,7 @@ public bool IsSatisfiedBy(ICall call) public string Format(ICallFormatter callFormatter) { - return callFormatter.Format(_methodInfo, _argumentSpecifications, new int[0]); + return callFormatter.Format(_methodInfo, _argumentSpecifications, new ArgumentMatchInfo[0]); } public IEnumerable NonMatchingArguments(ICall call) diff --git a/Source/NSubstitute/Core/ICallFormatter.cs b/Source/NSubstitute/Core/ICallFormatter.cs index 2ecbb61ce..fdfb78d64 100644 --- a/Source/NSubstitute/Core/ICallFormatter.cs +++ b/Source/NSubstitute/Core/ICallFormatter.cs @@ -1,11 +1,12 @@ using System.Collections.Generic; using System.Reflection; +using NSubstitute.Core.Arguments; namespace NSubstitute.Core { public interface ICallFormatter { string Format(ICall call, ICallSpecification withRespectToCallSpec); - string Format(MethodInfo methodInfoOfCall, IEnumerable arguments, IEnumerable argumentsToHighlight); + string Format(MethodInfo methodInfoOfCall, IEnumerable arguments, IEnumerable nonMatchingArguments); } } \ No newline at end of file