public static TestMatcherName For(object matcher) { if (matcher is TestMatcher.IInvariantTestMatcher invariant) { return(invariant.Matches() ? "Anything" : "Nothing"); } if (matcher is ISupportTestMatcher support) { return(For(support.RealMatcher)); } if (matcher is INotMatcher nt) { return(For(nt.InnerMatcher).Negated()); } var matcherType = matcher.GetType().GetTypeInfo(); if (matcherType.IsGenericType) { matcherType = matcherType.GetGenericTypeDefinition().GetTypeInfo(); } return(TestMatcherName.FromType(matcherType)); }
public TestFailure(TestMatcherName name) { _name = name; UserData = new UserDataCollection(); }
internal TestFailure(TestMatcherName name, object matcher) { _name = name; UserData = new UserDataCollection(matcher); }