コード例 #1
0
ファイル: FolderTest.cs プロジェクト: hl10502/XenCenter
 private Search EverythingInFolders()
 {
     QueryScope scope = new QueryScope(ObjectTypes.AllIncFolders);
     QueryFilter filter = new NullQuery<Folder>(PropertyNames.folder, false);
     Query q = new Query(scope, filter);
     Grouping grouping = new FolderGrouping((Grouping)null);
     return new Search(q, grouping, false, "", null, false);
 }
コード例 #2
0
ファイル: FolderTest.cs プロジェクト: huizh/xenadmin
 private Search EverythingInFolders()
 {
     QueryScope scope = new QueryScope(ObjectTypes.AllIncFolders);
     QueryFilter filter = new NullQuery<Folder>(PropertyNames.folder, false);
     Query q = new Query(scope, filter);
     Grouping grouping = new FolderGrouping((Grouping)null);
     return new Search(q, grouping, false, "", null, false);
 }
コード例 #3
0
ファイル: NullQueryTests.cs プロジェクト: gropax/phonos
        public void TestScope()
        {
            var q = new NullQuery();

            var word = new Word(
                phonemes: new[] { "a", "t", "a", "b", "l", "e" },
                graphicalForms: null,
                fields: null);

            var scope = new Interval(2, 2);

            Assert.Throws <ArgumentOutOfRangeException>(() => q.Match(word, 1, scope));
            QueryAssert.IsMatch(q, word, 2, new string[0], scope);
            QueryAssert.IsMatch(q, word, 3, new string[0], scope);
            QueryAssert.IsMatch(q, word, 4, new string[0], scope);
            Assert.Throws <ArgumentOutOfRangeException>(() => q.Match(word, 5, scope));
        }
コード例 #4
0
ファイル: NullQueryTests.cs プロジェクト: gropax/phonos
        public void Test()
        {
            var q = new NullQuery();

            var word = new Word(
                phonemes: new[] { "a", "t", "a", "b", "l", "e" },
                graphicalForms: null,
                fields: null);

            QueryAssert.IsMatch(q, word, 0, new string[0]);
            QueryAssert.IsMatch(q, word, 1, new string[0]);
            QueryAssert.IsMatch(q, word, 2, new string[0]);
            QueryAssert.IsMatch(q, word, 3, new string[0]);
            QueryAssert.IsMatch(q, word, 4, new string[0]);
            QueryAssert.IsMatch(q, word, 5, new string[0]);
            QueryAssert.IsMatch(q, word, 6, new string[0]);

            Assert.Throws <ArgumentOutOfRangeException>(() => q.Match(word, -1));
            Assert.Throws <ArgumentOutOfRangeException>(() => q.Match(word, 7));
        }