public void RegisterVariableShouldWorkCorrectly(string pattern, object value)
        {
            var item = new RegexAutoCompleteItem("", "", (v, o) => true, (v, o) => v);

            testee.RegisterVariable(pattern, o => value, item);

            Assert.AreEqual(1, evaluators.Count);
            Assert.AreEqual(1, testee.AutocompleteItems.Count());
            Assert.AreSame(item, testee.AutocompleteItems.ElementAt(0));
        }
        private static void RegisterDynamicVariableEvaluatorForMonthTimeSpan(DynamicVariableEvaluator evaluator)
        {
            var regex = new Regex("^(\\d+)(m|month)$", RegexOptions.Compiled | RegexOptions.IgnoreCase);
            var item  = new RegexAutoCompleteItem("NNNmonth", "Represents time span (e.g. 1month)", (v, o) => Regex.IsMatch(v, "^\\d+$"), (v, o) => v + "month");

            evaluator.RegisterVariable(regex, o => TimeSpan.FromDays(Int32.Parse(o.Groups[1].Value, CultureInfo.CurrentCulture) * 30), item);
        }
        private static void RegisterDynamicVariableEvaluatorForYearTimeSpan(DynamicVariableEvaluator evaluator)
        {
            var regex = new Regex("^(\\d+)(y|year)$", RegexOptions.Compiled | RegexOptions.IgnoreCase);
            var item  = new RegexAutoCompleteItem("NNNyear", "Represents time span (e.g. 1year)", (v, o) => Regex.IsMatch(v, "^\\d+$"), (v, o) => string.Format("{0}year", v));

            evaluator.RegisterVariable(regex, o => TimeSpan.FromDays(Int32.Parse(o.Groups[1].Value, CultureInfo.CurrentCulture) * 365), item);
        }