コード例 #1
0
        public static ParameterSpecification Type(this ParameterSpecification @this, Func <ParameterInfo, TypeSpecification, TypeSpecification> typeSpecification)
        {
            Guard.NotNull(@this, "this");
            Guard.NotNull(typeSpecification, "typeSpecification");

            return(@this.Combine(p => typeSpecification(p, TypeSpecificationBuilder.Any)(p.ParameterType)));
        }
コード例 #2
0
        public static ParameterSpecification Named(this ParameterSpecification @this, string name)
        {
            Guard.NotNull(@this, "this");
            Guard.NotNullOrWhiteSpace(name, "name");

            return(@this.Combine(x => Outcome.FailIf(x.Name != name, String.Format("Not named '{0}'.", name))));
        }
コード例 #3
0
 public static ParameterSpecification AtIndex(this ParameterSpecification @this, int index)
 {
     Guard.NotNull(@this, "this");
     return(@this.Combine(p => Outcome.FailIf(p.Position != index, "Not at correct index")));
 }