public void VerifyThatBooleanParameterTypeValidatesValue() { ValidationResult result; result = ValueValidator.Validate(this.booleanParameterType, "-"); Assert.AreEqual(ValidationResultKind.Valid, result.ResultKind); Assert.IsEmpty(result.Message); result = ValueValidator.Validate(this.booleanParameterType, true); Assert.AreEqual(ValidationResultKind.Valid, result.ResultKind); Assert.IsEmpty(result.Message); result = ValueValidator.Validate(this.booleanParameterType, false); Assert.AreEqual(ValidationResultKind.Valid, result.ResultKind); Assert.IsEmpty(result.Message); result = ValueValidator.Validate(this.booleanParameterType, 0); Assert.AreEqual(ValidationResultKind.Valid, result.ResultKind); Assert.IsEmpty(result.Message); result = ValueValidator.Validate(this.booleanParameterType, 1); Assert.AreEqual(ValidationResultKind.Valid, result.ResultKind); Assert.IsEmpty(result.Message); result = ValueValidator.Validate(this.booleanParameterType, -1); Assert.AreEqual(ValidationResultKind.Invalid, result.ResultKind); Assert.IsNotEmpty(result.Message); result = ValueValidator.Validate(this.booleanParameterType, "True"); Assert.AreEqual(ValidationResultKind.Valid, result.ResultKind); Assert.IsEmpty(result.Message); result = ValueValidator.Validate(this.booleanParameterType, "False"); Assert.AreEqual(ValidationResultKind.Valid, result.ResultKind); Assert.IsEmpty(result.Message); result = ValueValidator.Validate(this.booleanParameterType, "1"); Assert.AreEqual(ValidationResultKind.Valid, result.ResultKind); Assert.IsEmpty(result.Message); result = ValueValidator.Validate(this.booleanParameterType, "0"); Assert.AreEqual(ValidationResultKind.Valid, result.ResultKind); Assert.IsEmpty(result.Message); result = ValueValidator.Validate(this.booleanParameterType, "TRUE"); Assert.AreEqual(ValidationResultKind.Valid, result.ResultKind); Assert.IsEmpty(result.Message); result = ValueValidator.Validate(this.booleanParameterType, "FALSE"); Assert.AreEqual(ValidationResultKind.Valid, result.ResultKind); Assert.IsEmpty(result.Message); result = ValueValidator.Validate(this.booleanParameterType, "Falsch"); Assert.AreEqual(ValidationResultKind.Invalid, result.ResultKind); Assert.AreEqual("Falsch is not a valid boolean, valid values are: -,true,false,True,False,1,0", result.Message); result = ValueValidator.Validate(this.booleanParameterType, "-1"); Assert.AreEqual(ValidationResultKind.Invalid, result.ResultKind); Assert.AreEqual("-1 is not a valid boolean, valid values are: -,true,false,True,False,1,0", result.Message); }
public void HasTrailingSpacesAndItsNotAllowed() { var result = ValueValidator.Validate("myvalue ", 1, (x, y) => { return(ValidationResponse.Success); }); Assert.IsFalse(result.IsValid); Assert.AreEqual("Unexpected trailing space, Value \"myvalue \" in Column 1.", result.ValidationErrors[0]); }
public void Int16MaximumValueExceeded() { var result = ValueValidator.ValidateInt16("5", 1, maxValue: 4); Assert.IsFalse(result.IsValid); Assert.AreEqual("Maximum value 4 exceeded, Value \"5\" in Column 1.", result.ValidationErrors[0]); }
public void Int16DoesntMeetMinimumValue() { var result = ValueValidator.ValidateInt16("5", 1, minValue: 6); Assert.IsFalse(result.IsValid); Assert.AreEqual("Minimum value 6 not met, Value \"5\" in Column 1.", result.ValidationErrors[0]); }
private void Range(ExpressionType expType, RangeNode range, ValueValidator validator) { validator(expType, range.Start); if (range.End != null) { validator(expType, range.End); if (range.IsHalfOpen && ValuesAreEqual(expType, range.Start, range.End)) { throw new SchyntaxParseException("Start and end values of a half-open range cannot be equal.", Input, range.Start.Index); } } if (expType == ExpressionType.Dates && range.End != null) { // special validation to make the date range is sane var start = (DateValueNode)range.Start; var end = (DateValueNode)range.End; if (start.Year != null || end.Year != null) { if (start.Year == null || end.Year == null) { throw new SchyntaxParseException("Cannot mix full and partial dates in a date range.", Input, start.Index); } if (!IsStartBeforeEnd(start, end)) { throw new SchyntaxParseException("End date of range is before the start date.", Input, start.Index); } } } }
public void MinimumLengthNotMet() { var result = ValueValidator.Validate("123", 1, (x, y) => { return(ValidationResponse.Success); }, minLength: 4); Assert.IsFalse(result.IsValid); Assert.AreEqual("Minimum length 4 not met, Value \"123\" in Column 1.", result.ValidationErrors[0]); }
public void MaximumLengthExceeded() { var result = ValueValidator.Validate("123", 1, (x, y) => { return(ValidationResponse.Success); }, maxLength: 2); Assert.IsFalse(result.IsValid); Assert.AreEqual("Maximum length 2 exceeded, Value \"123\" in Column 1.", result.ValidationErrors[0]); }
/// <summary> /// /// </summary> /// <param name="entity"></param> /// <returns></returns> public bool Validate(object entity) { foreach (var _memberDescriptor in PropertyDescriptors) { var _isRequired = _memberDescriptor.ActionDescriptors.IsDeclared(x => x.IsRequired && x.PropertyDirection.HasFlag(DbQueryPropertyDirections.Input)); if (_isRequired) { var _value = _memberDescriptor.GetValue(entity); if (!ValueValidator.Validate(_value)) { if (null != Failed) { var _message = string.Format("The '{0}' property cannot be null.", _memberDescriptor.Name); var _exception = new DbQueryException(_message); Failed(this, new DbQueryFailedEventArgs(_exception)); } } if (null != Validated) { Validated(this, EventArgs.Empty); } } } return(true); }
private void Hide() { if (UILogic.Name.Equals(typeof(AddValueUILogic).Name)) { if (ValueValidator.ValidateQuantities(RecordManager.tempRecord.quantities)) { HideEntity(); } } else if (UILogic.Name.Equals(typeof(EnterExpressionUILogic).Name)) { Main.m_UI.GetOpenedUI <EnterExpressionUILogic>().UIEntity.GetComponent <EnterExpression>().Validate((res, message) => { if (res) { HideEntity(); } else { UIAPI.Instance.ShowModel(new SimpleModel() { ShowCancel = false, Title = "错误", Message = $"{message},请检查输入。" }); } }); } else { HideEntity(); } }
public void VerifyThatDateTimeParameterTypeValidatesValue() { ValidationResult result; result = ValueValidator.Validate(this.dateTimeParameterType, "-"); Assert.AreEqual(ValidationResultKind.Valid, result.ResultKind); Assert.IsEmpty(result.Message); result = ValueValidator.Validate(this.dateTimeParameterType, "2010-01-02T07:59:00Z"); Assert.AreEqual(ValidationResultKind.Valid, result.ResultKind); Assert.IsEmpty(result.Message); result = ValueValidator.Validate(this.dateTimeParameterType, "2009-10-23T16:04:23.332+02"); Assert.AreEqual(ValidationResultKind.Valid, result.ResultKind); Assert.IsEmpty(result.Message); result = ValueValidator.Validate(this.dateTimeParameterType, "2012-13-13T12:01:01+02"); Assert.AreEqual(ValidationResultKind.Invalid, result.ResultKind); var date = new DateTime(2002, 12, 1); result = ValueValidator.Validate(this.dateTimeParameterType, date); Assert.AreEqual(ValidationResultKind.Valid, result.ResultKind); Assert.IsEmpty(result.Message); }
public void VerifyThatDateParameterTypeValidatesValue_with_Z() { ValidationResult result = ValueValidator.Validate(this.dateParameterType, "1976-08-20Z"); Assert.AreEqual(ValidationResultKind.Invalid, result.ResultKind); Assert.AreEqual("1976-08-20Z is not a valid Date, valid dates are specified in ISO 8601 YYYY-MM-DD", result.Message); }
public void VerifyThatDateParameterTypeValidatesValue() { ValidationResult result; result = ValueValidator.Validate(this.dateParameterType, "-"); Assert.AreEqual(ValidationResultKind.Valid, result.ResultKind); Assert.IsEmpty(result.Message); result = ValueValidator.Validate(this.dateParameterType, "1976-08-20"); Assert.AreEqual(ValidationResultKind.Valid, result.ResultKind); Assert.IsEmpty(result.Message); result = ValueValidator.Validate(this.dateParameterType, "some text"); Assert.AreEqual(ValidationResultKind.Invalid, result.ResultKind); Assert.AreEqual("some text is not a valid Date, valid dates are specified in ISO 8601 YYYY-MM-DD", result.Message); result = ValueValidator.Validate(this.dateParameterType, "2012-13-13"); Assert.AreEqual(ValidationResultKind.Invalid, result.ResultKind); Assert.AreEqual("2012-13-13 is not a valid Date, valid dates are specified in ISO 8601 YYYY-MM-DD", result.Message); var date = new DateTime(2002, 12, 1); result = ValueValidator.Validate(this.dateParameterType, date); Assert.AreEqual(ValidationResultKind.Valid, result.ResultKind); Assert.IsEmpty(result.Message); var dateTime = new DateTime(2002, 12, 1, 1, 0, 1); result = ValueValidator.Validate(this.dateParameterType, dateTime); Assert.AreEqual(ValidationResultKind.Invalid, result.ResultKind); Assert.IsNotEmpty(result.Message); }
public void VerifyThatEnumerationParameterTypeValidatesValue() { ValidationResult result; result = ValueValidator.Validate(this.enumerationParameterType, "-"); Assert.AreEqual(ValidationResultKind.Valid, result.ResultKind); Assert.IsEmpty(result.Message); result = ValueValidator.Validate(this.enumerationParameterType, "low"); Assert.AreEqual(ValidationResultKind.Valid, result.ResultKind); Assert.IsEmpty(result.Message); result = ValueValidator.Validate(this.enumerationParameterType, "medium"); Assert.AreEqual(ValidationResultKind.Valid, result.ResultKind); Assert.IsEmpty(result.Message); result = ValueValidator.Validate(this.enumerationParameterType, "high"); Assert.AreEqual(ValidationResultKind.Invalid, result.ResultKind); Assert.AreEqual("The test Enumeration Parametertype does not contain the following value definition high, allowed values are: low, medium", result.Message); this.enumerationParameterType.AllowMultiSelect = true; result = ValueValidator.Validate(this.enumerationParameterType, "low | medium"); Assert.AreEqual(ValidationResultKind.Valid, result.ResultKind); Assert.IsEmpty(result.Message); }
public void VerifyThatSimpleQuantityKindValidatesIntegerNumberSet() { ValidationResult result; this.ratioScale.NumberSet = NumberSetKind.INTEGER_NUMBER_SET; string stringValue = "-13"; result = ValueValidator.Validate(this.simpleQuantityKind, this.ratioScale, stringValue); Assert.AreEqual(ValidationResultKind.Valid, result.ResultKind); Assert.IsEmpty(result.Message); int intValue = -13; result = ValueValidator.Validate(this.simpleQuantityKind, this.ratioScale, intValue); Assert.AreEqual(ValidationResultKind.Valid, result.ResultKind); Assert.IsEmpty(result.Message); double intdoubleValue = -13d; result = ValueValidator.Validate(this.simpleQuantityKind, this.ratioScale, intdoubleValue); Assert.AreEqual(ValidationResultKind.Valid, result.ResultKind); Assert.IsEmpty(result.Message); double doubleValue = -13.001d; result = ValueValidator.Validate(this.simpleQuantityKind, this.ratioScale, doubleValue); Assert.AreEqual(ValidationResultKind.Invalid, result.ResultKind); Assert.IsNotEmpty(result.Message); }
public void Int16InvalidValue() { var result = ValueValidator.ValidateInt16("ffdsfdsgds", 1); Assert.IsFalse(result.IsValid); Assert.AreEqual("Not Int16, Value \"ffdsfdsgds\" in Column 1.", result.ValidationErrors[0]); }
public void Run_NoError() { var r = new ValueValidator <TestData, int>(x => x.CountA, 1).Mandatory().Run(); Assert.IsNotNull(r); Assert.IsFalse(r.HasError); }
public EditPropertyWindow(string title, ValueValidator validator) { this.validator = validator; this.Text = "Edit " + title; this.MaximizeBox = false; this.MinimizeBox = false; }
public void ValidateEmptyValueAndItsAllowed() { var result1 = ValueValidator.Validate("", 1, (x, y) => { return(ValidationResponse.Success); }, allowEmptyValue: true); var result2 = ValueValidator.Validate(null, 1, (x, y) => { return(ValidationResponse.Success); }, allowEmptyValue: true); Assert.IsTrue(result1.IsValid); Assert.IsTrue(result2.IsValid); }
public ParamDelegates([NotNull] ValueGetter getter, [NotNull] ValueSetter setter, [CanBeNull] ValueValidator validator = null, [CanBeNull] StateUpdater updater = null) { Getter = getter ?? throw new ArgumentNullException(nameof(getter)); Setter = setter ?? throw new ArgumentNullException(nameof(setter)); Validator = validator; Updater = updater; }
public void VerifyThatSimpleQuantityKindValidatesNonDefaultValue() { ValidationResult result; result = ValueValidator.Validate(this.simpleQuantityKind, this.ratioScale, "13"); Assert.AreEqual(ValidationResultKind.Valid, result.ResultKind); Assert.IsEmpty(result.Message); }
public void VerifyThatTextParameterTypeValidatesValue() { ValidationResult result; result = ValueValidator.Validate(this.textParameterType, "-"); Assert.AreEqual(ValidationResultKind.Valid, result.ResultKind); Assert.IsEmpty(result.Message); }
public void VerifyThatSimpleQuantityKindInValidatesRealCommaSeparator() { ValidationResult result; this.ratioScale.NumberSet = NumberSetKind.REAL_NUMBER_SET; result = ValueValidator.Validate(this.simpleQuantityKind, this.ratioScale, "131,1"); Assert.AreEqual(ValidationResultKind.Invalid, result.ResultKind); Assert.IsNotEmpty(result.Message); }
/// <summary> /// Gets a value indicating whether the object is null or default. /// </summary> /// <param name="obj"></param> /// <param name="ignoreZero"></param> /// <returns></returns> public static bool IsNullOrDefault(object obj, bool ignoreZero = false) { if (null != obj) { return(!ValueValidator.Validate(obj, ignoreZero)); } return(true); }
public void ValidateEmptyValueAndItsNotAllowed() { var result1 = ValueValidator.Validate("", 1, (x, y) => { return(ValidationResponse.Success); }); var result2 = ValueValidator.Validate(null, 1, (x, y) => { return(ValidationResponse.Success); }); Assert.IsFalse(result1.IsValid); Assert.IsFalse(result2.IsValid); Assert.AreEqual("Unexpected empty value, Value \"\" in Column 1.", result1.ValidationErrors[0]); Assert.AreEqual("Unexpected empty value, Value \"\" in Column 1.", result2.ValidationErrors[0]); }
public void VerifyThatSimpleQuantityKindValidatesInvalidValue() { ValidationResult result; this.ratioScale.NumberSet = NumberSetKind.REAL_NUMBER_SET; result = ValueValidator.Validate(this.simpleQuantityKind, this.ratioScale, "a"); Assert.AreEqual(ValidationResultKind.Invalid, result.ResultKind); Assert.AreEqual("String:\"a\" is not a member of the REAL NUMBER SET", result.Message); }
/// <summary> /// Create all proper controls for an ElementItem using all information gathered. /// Usually, not all parameters need values. /// </summary> /// <param name="tag"> The XML Element to apply changes backwards and allow save. </param> /// <param name="name"> The name of the element. (Mandatory) </param> /// <param name="isRequired"> If the element is optional or mandatory. (Optional) </param> /// <param name="help"> Some help text if exists. (Optional) </param> /// <param name="controlTypes"> The special list that shows which controls should be made. (Mandatory) </param> /// <param name="typeOptions"> Can have these options: Constant/Variable/Function. (Used in Constant/Variable/Function only) </param> /// <param name="unitOptions"> What options to show in the unit dropdown. (Used in Constant/Variable only) </param> /// <param name="xUnitOptions"> What options to show in the x_unit dropdown. (Used in Variable only) </param> /// <param name="funcOptions"> What options to show in the functions dropdown. (Used in Function only) </param> /// <param name="keyOptions"> What options to show in the keywords dropdown. (Used in Keywords only) </param> public GeneralControl(string name, bool isRequired, string help, List<CustomControlType> controlTypes, List<string> typeOptions, List<string> unitOptions, List<string> xUnitOptions, List<string> funcOptions, List<string> keyOptions, Dictionary<CustomControlType, string> defaultValues, string defaultUnit, string defaultXUnit, ValueValidator valueValidator, SaveVariable saveVariableTable, TypeChange typeChange, UnitChange unitChange, XUnitChange xUnitChange) { CreateGeneralControl(name, isRequired, help, controlTypes, typeOptions, unitOptions, xUnitOptions, funcOptions, keyOptions, defaultValues, defaultUnit, defaultXUnit, valueValidator, saveVariableTable, typeChange, unitChange, xUnitChange); }
private void Start() { GetComponent <Button>().onClick.AddListener(() => { if (ValueValidator.ValidateQuantities(RecordManager.tempRecord.quantities)) { GameManager.Instance.SwitchProcedure <EnterExpressionProcedure>(); } }); }
public void Run_ErrorWithResult() { var r = new ValueValidator <TestData, int>(x => x.CountA, 0).Mandatory().Run(); Assert.IsNotNull(r); Assert.IsTrue(r.HasError); Assert.AreEqual(1, r.Messages.Count); Assert.AreEqual("Count A is required.", r.Messages[0].Text); Assert.AreEqual(MessageType.Error, r.Messages[0].Type); Assert.AreEqual("CountA", r.Messages[0].Property); }
public void ElementWaitForTimeoutTest5() { var element = new ElementWrapper(new MockIWebElement(), browser); element.WaitFor((elm) => { var valueValidator = new ValueValidator("asdasdasdasd"); var v = new OperationResultValidator(); var result = valueValidator.Validate(elm); v.Validate <UnexpectedElementException>(result); }, 2000, "test timeouted", checkInterval: 100); }
public void Add(string key, ValueValidator validator) { this.ValidateKey(key); if (validator == null) { throw new ArgumentNullException("validator"); } this.CreateValidatorsCollectionIfNotExists(key); this.TryToAddNewValidator(key, validator); }
public void VerifyThatSimpleQuantityKindValidatesRealWithFrenchCulture() { var testCulture = new CultureInfo("fr-FR"); Thread.CurrentThread.CurrentCulture = testCulture; ValidationResult result; this.ratioScale.NumberSet = NumberSetKind.REAL_NUMBER_SET; result = ValueValidator.Validate(this.simpleQuantityKind, this.ratioScale, "13.1e1"); Assert.AreEqual(ValidationResultKind.Valid, result.ResultKind); Assert.IsEmpty(result.Message); }
public void Run_Common_Error() { var cv = CommonValidator <int> .Create(v => v.Mandatory()); var r = new ValueValidator <TestData, int>(x => x.CountA, 0).Common(cv).Run(); Assert.IsNotNull(r); Assert.IsTrue(r.HasError); Assert.AreEqual(1, r.Messages.Count); Assert.AreEqual("Count A is required.", r.Messages[0].Text); Assert.AreEqual(MessageType.Error, r.Messages[0].Type); Assert.AreEqual("CountA", r.Messages[0].Property); }
public EditPropertyTextBoxWindow(string name, string value, ValueValidator validator) : base(name, validator) { this.SetMinimumClientSize (0, box.Height); this.Value = value; box.Text = value; box.Anchor = AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Right | AnchorStyles.Bottom; box.Width = this.ClientSize.Width - 19; box.Height = this.Confirm.Location.Y; box.Multiline = true; box.ScrollBars = ScrollBars.Vertical; box.KeyDown += onKeyDown; box.TextChanged += onTextChanged; this.Controls.Add (box); this.Shown += onShown; this.FormClosed += onFormClosed; }
private void CreateGeneralControl(string name, bool isRequired, string help, List<CustomControlType> controlTypes, List<string> typeOptions, List<string> unitOptions, List<string> xUnitOptions, List<string> funcOptions, List<string> keyOptions, Dictionary<CustomControlType, string> defaultValues, string defaultUnit, string defaultXUnit, ValueValidator valueValidator, SaveVariable saveVariableTable, TypeChange typeChange, UnitChange unitChange, XUnitChange xUnitChange) { _customControls = new List<CustomControl>(); //Handle bad situations if (controlTypes == null || controlTypes.Count < 1) return; //Initialize simple values Name = name; IsRequired = isRequired; Help = help ?? ""; _updateType = typeChange; // Create Controls and connect the XML Element - Object with the control via Tag. foreach (var type in controlTypes) switch (type) { case CustomControlType.Constant: if (typeOptions != null && typeOptions.Contains("Constant") && unitOptions != null) { _controlConstant = new ControlConstant( name, typeOptions, unitOptions, isRequired, help, this); // Set default values. if (defaultValues.ContainsKey(CustomControlType.Constant)) _controlConstant.DefaultValue = defaultValues[CustomControlType.Constant]; _controlConstant.DefaultUnit = defaultUnit; // Set Value Validator. _controlConstant.Validator = valueValidator; _controlConstant.UnitChange = unitChange; _customControls.Add(_controlConstant); } break; case CustomControlType.Variable: if (typeOptions != null && typeOptions.Contains("Variable") && unitOptions != null)// && xUnitOptions != null) { _controlVariable = new ControlVariable( name, typeOptions, unitOptions, xUnitOptions, isRequired, help, this); // Set default values. if (defaultValues.ContainsKey(CustomControlType.Variable)) _controlVariable.DefaultValue = defaultValues[CustomControlType.Variable]; _controlVariable.DefaultUnit = defaultUnit; _controlVariable.DefaultXUnit = defaultXUnit; // Set Value Validators. _controlVariable.Validator = valueValidator; _controlVariable.SaveVariableTable = saveVariableTable; _controlVariable.UnitChange = unitChange; _controlVariable.XUnitChange = xUnitChange; _customControls.Add(_controlVariable); } break; case CustomControlType.Function: if (typeOptions != null && typeOptions.Contains("Function") && funcOptions != null) { _controlFunction = new ControlFunction( name, typeOptions, funcOptions, isRequired, help, this); // Set default values. if (defaultValues.ContainsKey(CustomControlType.Function)) _controlFunction.DefaultValue = defaultValues[CustomControlType.Function]; // Set Value Validators. _controlFunction.Validator = valueValidator; _customControls.Add(_controlFunction); } break; case CustomControlType.Group: _controlGroup = new ControlGroup(name, isRequired, this); _customControls.Add(_controlGroup); break; case CustomControlType.Reference: _controlReference = new ControlReference(name, isRequired, help, this); _customControls.Add(_controlReference); // Set Value Validators. _controlReference.Validator = valueValidator; break; case CustomControlType.Keyword: _controlKeyword = new ControlKeyword(name, keyOptions, isRequired, help, this); // Set default values. if (defaultValues.ContainsKey(CustomControlType.Keyword)) _controlKeyword.DefaultValue = defaultValues[CustomControlType.Keyword]; // Set Value Validators. _controlKeyword.Validator = valueValidator; _customControls.Add(_controlKeyword); break; } //Find Default Control switch (controlTypes[0]) { case CustomControlType.Constant: CurrentControl = _controlConstant; break; case CustomControlType.Variable: CurrentControl = _controlVariable; break; case CustomControlType.Function: CurrentControl = _controlFunction; break; case CustomControlType.Group: CurrentControl = _controlGroup; break; case CustomControlType.Reference: CurrentControl = _controlReference; break; case CustomControlType.Keyword: CurrentControl = _controlKeyword; break; } // Update Items' values (default). CurrentControl.UpdateValues(); }
private void Range(ExpressionType expType, RangeNode range, ValueValidator validator) { validator(expType, range.Start); if (range.End != null) { validator(expType, range.End); if (range.IsHalfOpen && ValuesAreEqual(expType, range.Start, range.End)) throw new SchyntaxParseException("Start and end values of a half-open range cannot be equal.", Input, range.Start.Index); } if (expType == ExpressionType.Dates && range.End != null) { // special validation to make the date range is sane var start = (DateValueNode)range.Start; var end = (DateValueNode)range.End; if (start.Year != null || end.Year != null) { if (start.Year == null || end.Year == null) throw new SchyntaxParseException("Cannot mix full and partial dates in a date range.", Input, start.Index); if (!IsStartBeforeEnd(start, end)) throw new SchyntaxParseException("End date of range is before the start date.", Input, start.Index); } } }