public void SetParameters_ParamsNullOrNoDataType_Error() { CustomAssert.ThrowsException<CodedArgumentOutOfRangeException>(() => { EnumTypeConstraint c = new EnumTypeConstraint(); c.SetParametersInternal(new string[0], ParameterDataType.None); }); CustomAssert.ThrowsException<CodedArgumentNullException>(() => { EnumTypeConstraint c = new EnumTypeConstraint(); c.SetParametersInternal(null, ParameterDataType.Enum); }); }
public void SetParameters_ParamWhitespace_Error() { CustomAssert.ThrowsException<ConstraintConfigurationException>(() => { EnumTypeConstraint c = new EnumTypeConstraint(); c.SetParametersInternal(new string[] { " " }, ParameterDataType.Enum); }); }
public void SetParameters_Success() { string type = typeof(System.UriKind).AssemblyQualifiedName; EnumTypeConstraint c = new EnumTypeConstraint(); c.SetParametersInternal(new string[] { type }, ParameterDataType.Enum); Assert.AreEqual(type, c.TypeName); Assert.IsNotNull(c.ResolvedType); }