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))); }
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)))); }
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"))); }