public ListParameters ( ) : string>.System.Collections.Generic.IDictionary |
||
Результат | string>.System.Collections.Generic.IDictionary |
public override System.Collections.Generic.IDictionary<string, string> ListParameters()
{
var result = base.ListParameters();
if(MinLength.HasValue) result.Add("MinLength", MinLength.ToString());
if(MaxLength.HasValue) result.Add("MaxLength", MaxLength.ToString());
return result;
}
public void StringLengthRule_Takes_Min_And_Max_Lengths() { var rule = new StringLengthRule(1, 5); var parameters = rule.ListParameters(); Assert.Equal(2, parameters.Count); Assert.Equal("1", parameters["MinLength"]); Assert.Equal("5", parameters["MaxLength"]); }