コード例 #1
0
        public void Build_FiltersContainDisplayFolder_PostCommandFilterIsNotEmpty()
        {
            var discovery = new MeasureDiscoveryCommand("connectionString");

            var filters = new List <CaptionFilter>();

            filters.Add(new CaptionFilter("my perspective", DiscoveryTarget.Perspectives));
            filters.Add(new CaptionFilter("my measure-group", DiscoveryTarget.MeasureGroups));
            filters.Add(new CaptionFilter("my display-folder", DiscoveryTarget.DisplayFolders));
            filters.Add(new CaptionFilter("my measure", DiscoveryTarget.MeasureGroups));

            //Method under test
            discovery.Build(filters);

            Assert.That(discovery.PostCommandFilters, Is.Not.Null.And.Not.Empty);
        }
コード例 #2
0
        public void Build_FiltersContainDisplayFolder_CommandFiltersDoesNotContainDoubleAnd()
        {
            var discovery = new MeasureDiscoveryCommand("connectionString");

            var filters = new List <CaptionFilter>();

            filters.Add(new CaptionFilter("my perspective", DiscoveryTarget.Perspectives));
            filters.Add(new CaptionFilter("my measure-group", DiscoveryTarget.MeasureGroups));
            filters.Add(new CaptionFilter("my display-folder", DiscoveryTarget.DisplayFolders));
            filters.Add(new CaptionFilter("my measure", DiscoveryTarget.MeasureGroups));

            //Method under test
            var filterString = discovery.Build(filters);

            Assert.That(filterString, Is.Not.StringContaining("and  and"));
        }
コード例 #3
0
ファイル: MetadataAdomdExtractor.cs プロジェクト: zyh329/nbi
        public CubeMetadata GetFullMetadata()
        {
            var cube = new CubeMetadata();

            if (ProgressStatusChanged != null)
            {
                ProgressStatusChanged(this, new ProgressStatusEventArgs("Starting investigation ..."));
            }

            using (var cmd = new PerspectiveDiscoveryCommand(ConnectionString))
                cube.Import(cmd.Discover(null));

            using (var cmd = new DimensionDiscoveryCommand(ConnectionString))
                cube.Import(cmd.Discover(null));

            using (var cmd = new HierarchyDiscoveryCommand(ConnectionString))
                cube.Import(cmd.Discover(null));

            using (var cmd = new LevelDiscoveryCommand(ConnectionString))
                cube.Import(cmd.Discover(null));

            using (var cmd = new PropertyDiscoveryCommand(ConnectionString))
                cube.Import(cmd.Discover(null));

            using (var cmd = new MeasureGroupDiscoveryCommand(ConnectionString))
            {
                var rows = cmd.Discover(null);
                cube.Import(rows);
                //cube.Link(rows);
            }
            using (var cmd = new MeasureDiscoveryCommand(ConnectionString))
                cube.Import(cmd.Discover(null));

            if (ProgressStatusChanged != null)
            {
                ProgressStatusChanged(this, new ProgressStatusEventArgs("Cube investigated"));
            }

            return(cube);
        }