Example #1
0
        protected CallMethodResult Search(
            string description,
            DateTime?executedStartDate,
            DateTime?executedEndDate,
            List <RunStatus> status,
            StringMatchHowManyWordsToMatch howManyWordsToMatch,
            StringMatchWordOrders wordOrder,
            StringMatchWordComparisons wordComparison,
            bool caseSensitive,
            string charactersToIgnore)
        {
            var queryModel = new RunSearchQueryModel
            {
                Description       = description,
                ExecutedStartDate = executedStartDate,
                ExecutedEndDate   = executedEndDate,
                Status            = status
            };

            var stringMatchRules = new StringMatchRules(howManyWordsToMatch, wordOrder, wordComparison, caseSensitive,
                                                        new char[] { ' ' }, charactersToIgnore.ToCharArray());

            var res = Repository.Search(queryModel, stringMatchRules);

            TestContext.LastOperationCount   = res?.Items?.Count ?? 0;
            TestContext.LastCollectionResult = res?.Items;
            TestContext.LastSingleResult     = null;

            return(CallMethodResult.CreateHandled());
        }
Example #2
0
 public StringMatchRules(StringMatchHowManyWordsToMatch howManyWordsToMatch, StringMatchWordOrders wordOrder,
                         StringMatchWordComparisons wordComparison, bool caseSensitive,
                         IEnumerable <char> wordDelimiters, IEnumerable <char> charactersToIgnore)
 {
     HowManyWordsToMatch = howManyWordsToMatch;
     WordOrder           = wordOrder;
     WordComparison      = wordComparison;
     CaseSensitive       = caseSensitive;
     WordDelimiters      = wordDelimiters;
     CharactersToIgnore  = charactersToIgnore;
 }
Example #3
0
        protected CallMethodResult Search(
            string name,
            bool?isLibraried,
            StringMatchHowManyWordsToMatch howManyWordsToMatch,
            StringMatchWordOrders wordOrder,
            StringMatchWordComparisons wordComparison,
            bool caseSensitive)
        {
            var queryModel = new PassSearchQueryModel
            {
                Name        = name,
                IsLibraried = isLibraried
            };

            var freeTextMatchRules = new StringMatchRules(howManyWordsToMatch, wordOrder, wordComparison, caseSensitive,
                                                          new Char[] { ' ', ',' }, null);
            var res = Repository.Search(queryModel, freeTextMatchRules);

            TestContext.LastOperationCount   = res?.Items?.Count ?? 0;
            TestContext.LastCollectionResult = res?.Items?.Cast <object>().ToList();
            TestContext.LastSingleResult     = TestContext.LastOperationCount == 1 ? res.Items.First() : null;

            return(CallMethodResult.CreateHandled());
        }