Exemplo n.º 1
0
 ///  <summary>
 /// Constructor
 /// </summary>
 /// <param name="name">variable name</param>
 /// <param name="description">variable description</param>
 /// <param name="variableType">variable type</param>
 /// <param name="handler">a handler that can be use to validate or to provide list of possibel values</param>
 public VariableDefinition(
     string name,
     string description,
     VariableTypeEnum variableType,
     StepHandlerDefinition handler,
     ConstraintDefinition constraints)
 {
     Name              = name;
     Description       = description;
     VariableType      = variableType;
     HandlerDefinition = handler;
     Constraints       = constraints;
 }
Exemplo n.º 2
0
 public void Visit(ConstraintDefinition constraintsDefinition)
 {
     if (constraintsDefinition == null)
     {
         return;
     }
     if (!string.IsNullOrEmpty(constraintsDefinition.DefaultValue))
     {
         _sb.Append("|" + constraintsDefinition.DefaultValue);
     }
     if (!string.IsNullOrEmpty(constraintsDefinition.MaxValue))
     {
         _sb.Append("|" + constraintsDefinition.MaxValue);
     }
     if (!string.IsNullOrEmpty(constraintsDefinition.MinValue))
     {
         _sb.Append("|" + constraintsDefinition.MinValue);
     }
     constraintsDefinition.PossibleValues?.ToList().ForEach(v => _sb.Append("|" + v));
 }