Example #1
0
        public void MatchesQueryString_returns_true_if_searchable_name_first_letters_match_case_ignored()
        {
            WoosterAction wa = new WoosterAction();

            wa.SearchableName = "This is an action";
            Assert.AreEqual(true, wa.MatchesQueryString("t I A", true));
        }
Example #2
0
        public void MatchesQueryString_returns_true_if_searchable_name_contains_query_string_case_ignored()
        {
            WoosterAction wa = new WoosterAction();

            wa.SearchableName = "This is the searchable name";
            Assert.AreEqual(true, wa.MatchesQueryString("SEarchABle", false));
        }
Example #3
0
        public void MatchesQueryString_returns_false_if_searchable_name_does_not_contain_query_string()
        {
            WoosterAction wa = new WoosterAction();

            wa.SearchableName = "This is an action";
            Assert.AreEqual(false, wa.MatchesQueryString("SEarchABle", false));
        }
Example #4
0
        public void MatchesQueryString_returns_true_if_action_always_visible()
        {
            WoosterAction wa = new WoosterAction();

            wa.SearchableName = "fufufu";
            wa.AlwaysVisible  = true;
            Assert.AreEqual(true, wa.MatchesQueryString("hello", false));
        }
 public IEnumerable <IAction> GetActions(string queryString)
 {
     // calculate?..
     if (this._calculator.LooksLikeMath(queryString))
     {
         var result = this._calculator.Compute(queryString);
         if (result != null)
         {
             var action = new WoosterAction(string.Format("Copy result: {0}", result), s => Clipboard.SetText(result))
             {
                 Icon = this._calculator.Icon
             };
             yield return(action);
         }
     }
 }