Inheritance: System.Web.UI.DataSourceControl
コード例 #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 = false }
                       };

            results = snds.Select(DataSourceSelectArguments.Empty);

            //expected: 3 (test root and both normal and system folder)
            Assert.AreEqual(3, results.Count());
        }
コード例 #2
0
        public void SnDataSource_Execute_Top1()
        {
            DestroyPlayground();

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

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

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