Exemplo n.º 1
0
        public void SnDataSource_Execute_WithSystemFiles()
        {
            DestroyPlayground();

            TestEquipment.EnsureNode(_testRootPath + "/SystemFolder1");
            TestEquipment.EnsureNode(_testRootPath + "/Folder1");

            //create a datasource to query simple content
            var snds = new SenseNetDataSource {
                Query = "InTree:" + _testRootPath
            };
            var results = snds.Select(DataSourceSelectArguments.Empty);

            //expected: 2 (test root and the folder)
            Assert.AreEqual(2, results.Count());

            //include system files and folders too (switch off AutoFilters)
            snds = new SenseNetDataSource
            {
                Query    = "InTree:" + _testRootPath,
                Settings = new QuerySettings {
                    EnableAutofilters = FilterStatus.Disabled
                }
            };

            results = snds.Select(DataSourceSelectArguments.Empty);

            //expected: 3 (test root and both normal and system folder)
            Assert.AreEqual(3, results.Count());
        }
Exemplo n.º 2
0
        public void SnDataSource_Execute_Flatten1()
        {
            DestroyPlayground();

            TestEquipment.EnsureNode(_testRootPath + "/Folder1");
            TestEquipment.EnsureNode(_testRootPath + "/Folder1/Folder2");

            //create a datasource to query simple content
            var snds = new SenseNetDataSource {
                ContentPath = _testRootPath, FlattenResults = true
            };
            var results = snds.Select(DataSourceSelectArguments.Empty);

            //expected: Top 2 folders
            Assert.AreEqual(2, results.Count());
        }