예제 #1
0
        public FindResults DoContains()
        {
            FindResults results = new FindResults();
            List<string> findList = new List<string>(searchItems);

            for (int i = 0; i < searchCount; i++)
            {
                if (findList.Contains(searchTerms[i % searchTerms.Length]))
                {
                    results.FoundItem();
                }
                else
                {
                    results.NotFoundItem();
                }
            }

            return results;
        }
예제 #2
0
        public FindResults DoAny()
        {
            FindResults results = new FindResults();
            List<string> anyList = new List<string>(searchItems);

            for (int i = 0; i < searchCount; i++)
            {
                if (anyList.Any(test => test == searchTerms[i % searchTerms.Length]))
                {
                    results.FoundItem();
                }
                else
                {
                    results.NotFoundItem();
                }
            }

            return results;
        }
예제 #3
0
        public FindResults DoFind()
        {
            FindResults results = new FindResults();
            List<string> findList = new List<string>(searchItems);

            for (int i = 0; i < searchCount; i++)
            {
                var found = findList.Find(test => test == searchTerms[i % searchTerms.Length]);

                if (string.IsNullOrEmpty(found))
                {
                    results.NotFoundItem();
                }
                else
                {
                    results.FoundItem();
                }
            }

            return results;
        }
예제 #4
0
        public FindResults DoWhere()
        {
            FindResults results = new FindResults();
            List<string> whereList = new List<string>(searchItems);

            for (int i = 0; i < searchCount; i++)
            {
                var found = whereList.Where(test => test == searchTerms[i % searchTerms.Length]);

                if (found.Count() > 0)
                {
                    results.FoundItem();
                }
                else
                {
                    results.NotFoundItem();
                }
            }

            return results;
        }