public void ExecuteQueryTest()
        {
            _alphaEngine = new AlphaEngine(_map);
            AlphaEngine alphaEngine     = _alphaEngine.AddMustIncludes("The", "WitcheR", "A").AddLeastIncludes("HunTeR", "Bank");
            AlphaEngine copyAlphaEngine = alphaEngine.Clone();

            Assert.Equal(new List <string>()
            {
                "1.txt", "2.txt", "3.txt"
            }, alphaEngine.ExecuteQuery());
            Assert.Equal(new List <string>()
            {
                "2.txt"
            }, copyAlphaEngine.AddExcludes("role-playing").ExecuteQuery());
        }
Exemple #2
0
        private void AddWord(string word)
        {
            char starter = word[0];

            switch (starter)
            {
            case '+':
                _alphaEngine = _alphaEngine.AddLeastIncludes(word.Substring(1));
                break;

            case '-':
                _alphaEngine = _alphaEngine.AddExcludes(word.Substring(1));
                break;

            default:
                _alphaEngine = _alphaEngine.AddMustIncludes(word);
                break;
            }
        }