/// <summary> /// Match any argument value compatible with type <typeparamref name="T"/>. /// </summary> /// <typeparam name="T"></typeparam> /// <returns></returns> public static T Any <T>() { return(ArgSpecQueue.EnqueueSpecFor <T>(new AnyArgumentMatcher(typeof(T)))); }
/// <summary> /// Verify the NSubstitute call using FluentAssertions. /// </summary> /// <example> /// <code> /// var sub = Substitute.For<ISomeInterface>(); /// sub.InterestingMethod("Hello hello"); /// /// sub.Received().InterestingMethod(Verify.That<string>(s => s.Should().StartWith("hello").And.EndWith("goodbye"))); /// </code> /// Results in the failure message: /// <code> /// Expected to receive a call matching: /// SomeMethod(" /// Expected string to start with /// "hello", but /// "Hello hello" differs near "Hel" (index 0). /// Expected string /// "Hello hello" to end with /// "goodbye".") /// Actually received no matching calls. /// Received 1 non-matching call(non-matching arguments indicated with '*' characters): /// SomeMethod(*"Hello hello"*) /// </code> /// </example> /// <typeparam name="T">Type of argument to verify.</typeparam> /// <param name="action">Action in which to perform FluentAssertions verifications.</param> /// <returns></returns> public static T That <T>(Action <T> action) => Queue.EnqueueSpecFor <T>(new AssertionMatcher <T>(action));