Beispiel #1
0
 internal AndSupportingExtension(
     IHave <Type> continuation,
     string member,
     SupportingExtension supportingExtension)
 {
     _continuation = continuation;
     _member       = member;
     With          = supportingExtension;
 }
Beispiel #2
0
        /// <summary>
        /// Asserts that the controller has the named method
        /// </summary>
        /// <param name="have"></param>
        /// <param name="method"></param>
        /// <returns></returns>
        public static SupportingExtension Method(
            this IHave <Type> have,
            string method
            )
        {
            var result = new SupportingExtension();

            have.AddMatcher(
                actual =>
            {
                result.Member       = method;
                result.Continuation = have;
                var passed          = actual.GetMethod(method) != null;
                return(new MatcherResult(
                           passed,
                           () => $"Expected type {actual} to have method {method}"));
            });
            return(result);
        }