public void TryToApplyOnlyMatchingArrangements() { // Given var signature = typeof(IFooFuncValueTypeParameterless <int>) .GetMethod(nameof(IFooFuncValueTypeParameterless <int> .MethodWithoutParameter)) ?? throw new InvalidOperationException(); var otherSignature = typeof(IFooFuncValueTypeParameterIn <int>) .GetMethod(nameof(IFooFuncValueTypeParameterIn <int> .MethodWithOneParameter)) ?? throw new InvalidOperationException(); var returnValueFeature = new ReturnValueInvocation <int>(); var invocation = new Invocation(signature, returnValueFeature); var arrangment = new ReturnValueArrangement <int>(signature, 42); var otherArrangment = new ReturnValueArrangement <int>(otherSignature, 13); var arrangmentCollection = new ArrangementCollection(arrangment, otherArrangment); // When var hasAppliedArrangment = arrangmentCollection.TryApplyTo(invocation); // Then Assert.True(hasAppliedArrangment); Assert.True(invocation.HasFeature <IReturnValue <int> >()); var feature = invocation.GetFeature <IReturnValue <int> >(); Assert.Equal(42, feature.ReturnValue); }