Exemple #1
0
        public void Matches_GivenMemberCommand_EngineCalledOnceWithParametersComingFromMemberCommand()
        {
            var exp = "Expected member";
            var cmd = new DiscoveryRequestFactory().Build(
                "ConnectionString",
                "member-caption",
                "perspective",
                "dimension",
                null,
                null);

            var memberStub = new Mock<NBi.Core.Analysis.Member.Member>();
            var member1 = memberStub.Object;
            var member2 = memberStub.Object;
            var members = new MemberResult();
            members.Add(member1);
            members.Add(member2);

            var meMock = new Mock<MembersAdomdEngine>();
            meMock.Setup(engine => engine.GetMembers(cmd))
                .Returns(members);
            var me = meMock.Object;

            var containsConstraint = new ContainConstraint(exp) { MembersEngine = me };

            //Method under test
            containsConstraint.Matches(cmd);

            //Test conclusion
            meMock.Verify(engine => engine.GetMembers(cmd), Times.Once());
        }
        public void GetMembers_ByHierarchy_ReturnListMembersWithCorrectLevelNumber()
        {
            //Buiding object used during test
            var mae = new MembersAdomdEngine();
            var disco = new DiscoveryRequestFactory().Build(
                ConnectionStringReader.GetAdomd(),
                string.Empty,
                "Adventure Works",
                "Geography",
                "Geography",
                null
                );

            //Call the method to test
            var actual = mae.GetMembers(disco);

            ////Assertion
            Assert.That(actual, Has.Count.GreaterThan(0));
            //0 = All
            Assert.That(List.Map(actual).Property("LevelNumber"), Has.Some.EqualTo(0));
            //1 = Country
            Assert.That(List.Map(actual).Property("LevelNumber"), Has.Some.EqualTo(1));
            //2 = State/Province
            Assert.That(List.Map(actual).Property("LevelNumber"), Has.Some.EqualTo(2));
            //3 = Town
            Assert.That(List.Map(actual).Property("LevelNumber"), Has.Some.EqualTo(3));
            //4 = Zip code
            Assert.That(List.Map(actual).Property("LevelNumber"), Has.Some.EqualTo(4));
            //Nothing else
            Assert.That(List.Map(actual).Property("LevelNumber"), Has.All.LessThanOrEqualTo(4));
        }
        public void Build_MemberCaptionNotFilled_FunctionIsSetToMembers()
        {
            var facto = new DiscoveryRequestFactory();

            var disco = facto.Build("connectionString", string.Empty, "perspective", "dimension", "hierarchy", null);

            //Assertion
            Assert.That(disco.Function.ToLower(), Is.EqualTo("Members".ToLower()));
        }
        public void Build_MemberCaptionFilled_MemberCaptionIsSet()
        {
            var facto = new DiscoveryRequestFactory();

            var disco = facto.Build("connectionString", "parent-member", "perspective", "dimension", "hierarchy", null);

            //Assertion
            Assert.That(disco.MemberCaption, Is.EqualTo("parent-member"));
        }
        public void Matches_ActualEqualToExpectation_Success()
        {
            var discovery = new DiscoveryRequestFactory().BuildDirect(
                        ConnectionStringReader.GetAdomd()
                        , DiscoveryTarget.Perspectives
                        , new List<IFilter>());

            var expected = new string[] { "Adventure Works", "Channel Sales", "Direct Sales", "Finance", "Sales Summary", "Sales Targets" };
            var ctr = new EquivalentToConstraint(expected);

            //Method under test
            Assert.That(discovery, ctr);
        }
Exemple #6
0
        public void WriteTo_FailingAssertionForListOfLevels_TextContainsFewKeyInfo()
        {
            var exp = new string[] { "Expected level 1", "Expected level 2" };
            var request = new DiscoveryRequestFactory().BuildDirect(
                        "connectionString",
                        DiscoveryTarget.Hierarchies,
                        new List<IFilter>()
                            {
                                new CaptionFilter("perspective-name", DiscoveryTarget.Perspectives)
                                , new CaptionFilter("dimension-caption", DiscoveryTarget.Dimensions)
                                , new CaptionFilter("hierarchy-caption", DiscoveryTarget.Hierarchies)
                        });

            var elStub = new Mock<IField>();
            var el1 = elStub.Object;
            var el2 = elStub.Object;
            var elements = new List<IField>();
            elements.Add(el1);
            elements.Add(el2);

            var commandStub = new Mock<AdomdDiscoveryCommand>("connectionString");
            commandStub.Setup(f => f.Execute())
                .Returns(elements);

            var factoryStub = new Mock<AdomdDiscoveryCommandFactory>();
            factoryStub.Setup(f => f.BuildExact(request))
                .Returns(commandStub.Object);
            var factory = factoryStub.Object;

            var containsConstraint = new SubsetOfConstraint(exp) { CommandFactory = factory };

            //Method under test
            string assertionText = null;
            try
            {
                Assert.That(request, containsConstraint);
            }
            catch (AssertionException ex)
            {
                assertionText = ex.Message;
            }

            //Test conclusion
            Assert.That(assertionText, Is.StringContaining("set").And
                                            .StringContaining("perspective-name").And
                                            .StringContaining("dimension-caption").And
                                            .StringContaining("hierarchy-caption").And
                                            .StringContaining("levels").And
                                            .StringContaining("Expected level 1").And
                                            .StringContaining("Expected level 2"));
        }
Exemple #7
0
        public void ExistsConstraint_ExistingPerspectiveButWrongCaseWithIgnoreCaseFalse_Failure()
        {
            var discovery = new DiscoveryRequestFactory().BuildDirect(
                        ConnectionStringReader.GetAdomd()
                        , DiscoveryTarget.Perspectives
                        , new List<IFilter>() {
                            new CaptionFilter("Adventure Works".ToLower(), DiscoveryTarget.Perspectives)
                        });

            var ctr = new ExistsConstraint();

            //Method under test
            Assert.Throws<AssertionException>(delegate { Assert.That(discovery, ctr); });
        }
Exemple #8
0
        public void Matches_ActualEqualToExpectationCaseNonMatching_Success()
        {
            var discovery = new DiscoveryRequestFactory().BuildDirect(
                        ConnectionStringReader.GetAdomd()
                        , DiscoveryTarget.Perspectives
                        , new List<IFilter>());

            var expected = new string[] { "Adventure Works".ToUpper(), "Channel Sales".ToLower(), "Direct Sales", "Finance", "Mined Customers", "Sales Summary", "Sales Targets" };
            var ctr = new SubsetOfConstraint(expected);
            ctr = ctr.IgnoreCase;

            //Method under test
            Assert.That(discovery, ctr);
        }
Exemple #9
0
        public void ContainConstraint_FindExistingMeasureGroup_Success()
        {
            var discovery = new DiscoveryRequestFactory().BuildDirect(
                        ConnectionStringReader.GetAdomd()
                        , DiscoveryTarget.MeasureGroups
                        , new List<IFilter>()
                            {
                                new CaptionFilter("Adventure Works", DiscoveryTarget.Perspectives)
                        });

            var ctr = new ContainConstraint("Reseller Orders");

            //Method under test
            Assert.That(discovery, ctr);
        }
Exemple #10
0
        public void LinkedToConstraint_ExistingPerspectiveDimensionAndNotExistingMeasureGroup_Failure()
        {
            var discovery = new DiscoveryRequestFactory().BuildRelation(
                        ConnectionStringReader.GetAdomd()
                        , DiscoveryTarget.MeasureGroups
                        , new List<IFilter>() {
                            new CaptionFilter("Adventure Works", DiscoveryTarget.Perspectives)
                            , new CaptionFilter("Customer", DiscoveryTarget.Dimensions)
                        });

            var ctr = new LinkedToConstraint("Not existing");

            //Method under test
            Assert.Throws<AssertionException>(delegate { Assert.That(discovery, ctr); });
        }
Exemple #11
0
        public void LinkedToConstraint_ExistingPerspectiveDimensionAndMeasureGroupLinked_Success()
        {
            var discovery = new DiscoveryRequestFactory().BuildRelation(
                        ConnectionStringReader.GetAdomd()
                        , DiscoveryTarget.MeasureGroups
                        , new List<IFilter>() {
                            new CaptionFilter("Adventure Works", DiscoveryTarget.Perspectives)
                            , new CaptionFilter("Customer", DiscoveryTarget.Dimensions)
                        });

            var ctr = new LinkedToConstraint("Internet Sales");

            //Method under test
            Assert.That(discovery, ctr);
        }
Exemple #12
0
        public void ContainConstraint_FindExistingHierarchyBellowSpecificDimension_Success()
        {
            var discovery = new DiscoveryRequestFactory().BuildDirect(
                        ConnectionStringReader.GetAdomd()
                        , DiscoveryTarget.Hierarchies
                        , new List<IFilter>()
                            {
                                new CaptionFilter("Adventure Works", DiscoveryTarget.Perspectives)
                                , new CaptionFilter("Product", DiscoveryTarget.Dimensions)
                        });

            var ctr = new ContainConstraint("Product Model Lines");

            //Method under test
            Assert.That(discovery, ctr);
        }
        public void Matches_ActualSubsetOfExpectation_Failure()
        {
            var discovery = new DiscoveryRequestFactory().BuildDirect(
                        ConnectionStringReader.GetAdomd()
                        , DiscoveryTarget.Perspectives
                        , new List<IFilter>());

            var expectedStrings = new string[] { "Adventure Works", "Channel Sales", "Direct Sales", "Finance", "Mined Customers", "Sales Summary", "Sales Targets" };
            var expected = new List<string>();
            expected.AddRange(expectedStrings);
            expected.Add("New perspective");
            var ctr = new EquivalentToConstraint(expected);

            //Method under test
            Assert.That(ctr.Matches(discovery), Is.False);
        }
Exemple #14
0
        public void ExistsConstraint_ExistingPerspectiveButWrongCaseWithIgnoreCaseTrue_Success()
        {
            var discovery = new DiscoveryRequestFactory().BuildDirect(
                        ConnectionStringReader.GetAdomd()
                        , DiscoveryTarget.Perspectives
                        , new List<IFilter>() {
                            new CaptionFilter("Adventure Works", DiscoveryTarget.Perspectives),
                            new CaptionFilter("Date", DiscoveryTarget.Dimensions)
                        });

            var ctr = new ExistsConstraint();
            ctr = ctr.IgnoreCase;

            //Method under test
            Assert.That(discovery, ctr);
        }
        public void Execute_TabularDateDimensionLinkedToThreeMeasureGroups_ListStructureContainingThreeElements()
        {
            var disco = new DiscoveryRequestFactory().BuildRelation(
                        ConnectionStringReader.GetAdomd()
                        , DiscoveryTarget.MeasureGroups
                        , new List<IFilter>() {
                            new CaptionFilter("Internet Operation", DiscoveryTarget.Perspectives)
                            , new CaptionFilter("Date", DiscoveryTarget.Dimensions)
                        });

            var factory = new AdomdDiscoveryCommandFactory();
            var cmd = factory.BuildExact(disco);

            var structs = cmd.Execute();

            Assert.That(structs.Count(), Is.EqualTo(3));
        }
        public void Execute_TabularDateDimensionWithHeighTeenHierarchies_ListStructureContainingSevenTeenElements()
        {
            var disco = new DiscoveryRequestFactory().BuildDirect(
                ConnectionStringReader.GetAdomdTabular(),
                DiscoveryTarget.Hierarchies,
                new List<IFilter>() {
                    new CaptionFilter("Internet Operation", DiscoveryTarget.Perspectives),
                    new CaptionFilter("Date", DiscoveryTarget.Dimensions)
                });

            var factory = new AdomdDiscoveryCommandFactory();
            var cmd = factory.BuildExact(disco);

            var structs = cmd.Execute();

            Assert.That(structs.Count(), Is.EqualTo(17));
        }
Exemple #17
0
        public void ContainConstraint_FindExistingLevel_Success()
        {
            var discovery = new DiscoveryRequestFactory().BuildDirect(
                        ConnectionStringReader.GetAdomd()
                        , DiscoveryTarget.Levels
                        , new List<IFilter>()
                            {
                                new CaptionFilter("Adventure Works", DiscoveryTarget.Perspectives)
                                , new CaptionFilter("Customer", DiscoveryTarget.Dimensions)
                                , new CaptionFilter("Customer Geography", DiscoveryTarget.Hierarchies)
                        });

            var ctr = new ContainConstraint("City");

            //Method under test
            Assert.That(discovery, ctr);
        }
        public void Execute_DateDimensionLinkedToElevenMeasureGroups_ListStructureContainingTenElements()
        {
            var disco = new DiscoveryRequestFactory().BuildRelation(
                        ConnectionStringReader.GetAdomd()
                        , DiscoveryTarget.MeasureGroups
                        , new List<IFilter>() {
                            new CaptionFilter("Adventure Works", DiscoveryTarget.Perspectives)
                            , new CaptionFilter("Customer", DiscoveryTarget.Dimensions)
                        });

            var factory = new AdomdDiscoveryCommandFactory();
            var cmd = factory.BuildExact(disco);

            var structs = cmd.Execute();

            Assert.That(structs.Count(), Is.EqualTo(10));
        }
        public void WriteTo_FailingAssertionForListOfLevels_TextContainsFewKeyInfo()
        {
            var exp = new string[] { "Expected member 1", "Expected member 2" };
            var cmd = new DiscoveryRequestFactory().Build(
                        "connectionString",
                        "member-caption",
                        "perspective-name",
                        "dimension-caption", "hierarchy-caption", null);

            var memberStub = new Mock<NBi.Core.Analysis.Member.Member>();
            var member1 = memberStub.Object;
            var member2 = memberStub.Object;
            var members = new MemberResult();
            members.Add(member1);
            members.Add(member2);

            var meMock = new Mock<MembersAdomdEngine>();
            meMock.Setup(engine => engine.GetMembers(cmd))
                .Returns(members);
            var me = meMock.Object;

            var equivalentConstraint = new EquivalentToConstraint(exp) { MembersEngine = me };

            //Method under test
            string assertionText = null;
            try
            {
                Assert.That(cmd, equivalentConstraint);
            }
            catch (AssertionException ex)
            {
                assertionText = ex.Message;
            }

            //Test conclusion
            Assert.That(assertionText, Is.StringContaining("perspective-name").And
                                            .StringContaining("dimension-caption").And
                                            .StringContaining("hierarchy-caption").And
                                            .StringContaining("equivalent to").And
                                            .StringContaining("Expected member 1").And
                                            .StringContaining("Expected member 2"));
        }
Exemple #20
0
        public void Matches_GivenDiscoveryRequestFailing_InvestigateCommandCalledOnce()
        {
            var request = new DiscoveryRequestFactory().BuildDirect(
                        "connectionString",
                        DiscoveryTarget.MeasureGroups,
                        new List<IFilter>()
                            {
                                new CaptionFilter("perspective-name", DiscoveryTarget.Perspectives)
                                , new CaptionFilter("measure-group", DiscoveryTarget.MeasureGroups)
                                , new CaptionFilter("measure", DiscoveryTarget.Measures)
                        });

            var elements = new List<IField>();

            var commandExactStub = new Mock<AdomdDiscoveryCommand>("connectionString");
            commandExactStub.Setup(f => f.Execute())
                .Returns(elements);

            var commandExternalMock = new Mock<AdomdDiscoveryCommand>("connectionString");
            commandExternalMock.Setup(f => f.Execute())
                .Returns(elements);

            var factoryStub = new Mock<AdomdDiscoveryCommandFactory>();
            factoryStub.Setup(f => f.BuildExact(request))
                .Returns(commandExactStub.Object);

            factoryStub.Setup(f => f.BuildExternal(It.IsAny<MetadataDiscoveryRequest>()))
                .Returns(commandExternalMock.Object);
            var factory = factoryStub.Object;

            var ctr = new ExistsConstraint() { CommandFactory = factory };

            //Method under test
            try
            {
                Assert.That(request, ctr);
            }
            catch { }

            //Test conclusion
            commandExternalMock.Verify(c => c.Execute(), Times.Once());
        }
        public void GetMembersDax_ByLevel_ReturnListMembersWithCorrectCaptions()
        {
            //Buiding object used during test
            var mae = new MembersAdomdEngine();
            var disco = new DiscoveryRequestFactory().Build(
                ConnectionStringReader.GetAdomdTabular(),
                string.Empty,
                "Internet Operation",
                "Geography",
                "Geography",
                "Country Region"
                );

            //Call the method to test
            var actual = mae.GetMembers(disco);

            ////Assertion
            Assert.That(List.Map(actual).Property("Caption"), Has.None.EqualTo("All"));
            Assert.That(List.Map(actual).Property("Caption"), Has.Member("Canada"));
            Assert.That(List.Map(actual).Property("Caption"), Has.Member("France"));
        }
        public void GetMembers_ByHierarchy_ReturnListMembersWithCorrectCaptions()
        {
            //Buiding object used during test
            var mae = new MembersAdomdEngine();
            var disco = new DiscoveryRequestFactory().Build(
                ConnectionStringReader.GetAdomd(),
                string.Empty,
                "Adventure Works",
                "Geography",
                "Geography",
                null
                );

            //Call the method to test
            var actual = mae.GetMembers(disco);

            //Assertion
            Assert.That(List.Map(actual).Property("Caption"), Has.Member("All Geographies"));
            Assert.That(List.Map(actual).Property("Caption"), Has.Member("Canada"));
            Assert.That(List.Map(actual).Property("Caption"), Has.Member("France"));
        }
        internal MetadataDiscoveryRequest Build(AbstractItem item, MetadataDiscoveryRequestType type)
        {
            var properties = new string[] { "Perspective", "Dimension", "Hierarchy", "Level", "Property", "MeasureGroup", "DisplayFolder", "Measure", "Table", "Column" };

            IFilter filter = null;
            var filters = new List<IFilter>();
            foreach (var property in properties)
            {
                filter = BuildCaptionFilter(item, property);
                if (filter != null)
                    filters.Add(filter);
            }

            var target = GetTarget(item);

            filter = BuildCaptionFilterForCaptionProperty(item, target);
            if (filter != null)
                filters.Add(filter);

            var connectionString = item.GetConnectionString();

            var factory = new DiscoveryRequestFactory();
            MetadataDiscoveryRequest request = null;
            switch (type)
            {
                case MetadataDiscoveryRequestType.Direct:
                    request = factory.BuildDirect(connectionString, target, filters);
                    break;
                case MetadataDiscoveryRequestType.Relation:
                    target = GetTargetRelation(item);
                    request = factory.BuildRelation(connectionString, target, filters);
                    break;
                default:
                    break;
            }
            return request;
        }
Exemple #24
0
        public void Matches_GivenDiscoveryRequest_CommandCalledOnce()
        {
            var request = new DiscoveryRequestFactory().BuildDirect(
                        "connectionString",
                        DiscoveryTarget.MeasureGroups,
                        new List<IFilter>()
                            {
                                new CaptionFilter("perspective-name", DiscoveryTarget.Perspectives)
                                , new CaptionFilter("measure-group", DiscoveryTarget.MeasureGroups)
                                , new CaptionFilter("measure", DiscoveryTarget.Measures)
                        });

            var elStub = new Mock<IField>();
            var el1 = elStub.Object;
            var el2 = elStub.Object;
            var elements = new List<IField>();
            elements.Add(el1);
            elements.Add(el2);

            var commandMock = new Mock<AdomdDiscoveryCommand>("connectionString");
            commandMock.Setup(f => f.Execute())
                .Returns(elements);

            var factoryStub = new Mock<AdomdDiscoveryCommandFactory>();
            factoryStub.Setup(f => f.BuildExact(request))
                .Returns(commandMock.Object);
            var factory = factoryStub.Object;

            var ctr = new ExistsConstraint() { CommandFactory = factory };

            //Method under test
            ctr.Matches(request);

            //Test conclusion
            commandMock.Verify(c => c.Execute(), Times.Once());
        }
Exemple #25
0
        public void Matches_GivenDiscoveryRequest_FactoryCalledOnceWithParametersComingFromRequest()
        {
            var exp = "Expected hierarchy";
            var request = new DiscoveryRequestFactory().BuildDirect(
                        "connectionString",
                        DiscoveryTarget.Dimensions,
                        new List<IFilter>()
                            {
                                new CaptionFilter("perspective-name", DiscoveryTarget.Perspectives)
                                , new CaptionFilter("dimension-caption", DiscoveryTarget.Dimensions)
                        });

            var elStub = new Mock<IField>();
            var el1 = elStub.Object;
            var el2 = elStub.Object;
            var elements = new List<IField>();
            elements.Add(el1);
            elements.Add(el2);

            var commandStub = new Mock<AdomdDiscoveryCommand>("connectionString");
            commandStub.Setup(f => f.Execute())
                .Returns(elements);

            var factoryMock = new Mock<AdomdDiscoveryCommandFactory>();
            factoryMock.Setup(f => f.BuildExact(request))
                .Returns(commandStub.Object);
            var factory = factoryMock.Object;

            var containsConstraint = new ContainConstraint(exp) { CommandFactory = factory };

            //Method under test
            containsConstraint.Matches(request);

            //Test conclusion
            factoryMock.Verify(f => f.BuildExact(request), Times.Once());
        }
        public void Matches_SqlQueryAndMembers_Succesful()
        {
            var command = new SqlCommand();
            command.Connection = new SqlConnection(ConnectionStringReader.GetSqlClient());
            command.CommandText = "select " +
                "'Executive General and Administration' union select " +
                "'Inventory Management' union select " +
                "'Manufacturing' union select " +
                "'Research and Development' union select " +
                "'Quality Assurance' union select " +
                "'Sales and Marketing' ";

            var discovery = new DiscoveryRequestFactory().Build(
                        ConnectionStringReader.GetAdomd()
                        , "Corporate"
                        , "Adventure Works"
                        , "Department"
                        , "Departments"
                        , null);

            var ctr = new EquivalentToConstraint(command);

            Assert.That(discovery, ctr);
        }
Exemple #27
0
        public void WriteTo_FailingAssertionForOneMeasureGroup_TextContainsFewKeyInfo()
        {
            var exp = "Expected measure";
            var request = new DiscoveryRequestFactory().BuildDirect(
                        "connectionString",
                        DiscoveryTarget.MeasureGroups,
                        new List<IFilter>()
                            {
                                new CaptionFilter("perspective-name", DiscoveryTarget.Perspectives)
                                , new CaptionFilter("measure-group-caption", DiscoveryTarget.MeasureGroups)
                        });

            var elStub = new Mock<IField>();
            var el1 = elStub.Object;
            var el2 = elStub.Object;
            var elements = new List<IField>();
            elements.Add(el1);
            elements.Add(el2);

            var commandStub = new Mock<AdomdDiscoveryCommand>("connectionString");
            commandStub.Setup(f => f.Execute())
                .Returns(elements);

            var factoryStub = new Mock<AdomdDiscoveryCommandFactory>();
            factoryStub.Setup(f => f.BuildExact(request))
                .Returns(commandStub.Object);
            var factory = factoryStub.Object;

            var containsConstraint = new ContainConstraint(exp) { CommandFactory = factory };

            //Method under test
            string assertionText = null;
            try
            {
                Assert.That(request, containsConstraint);
            }
            catch (AssertionException ex)
            {
                assertionText = ex.Message;
            }

            //Test conclusion
            Assert.That(assertionText, Is.StringContaining("perspective-name").And
                                            .StringContaining("measure-group-caption").And
                                            .StringContaining("Expected measure"));
        }
        public void GetPartialMetadata_TabularMeasureGroupsForInternetOperation_ThreeElements()
        {
            var disco = new DiscoveryRequestFactory().BuildDirect(
                ConnectionStringReader.GetAdomdTabular(),
                DiscoveryTarget.MeasureGroups,
                new List<IFilter>() {
                    new CaptionFilter("Internet Operation", DiscoveryTarget.Perspectives),
                });

            var factory = new AdomdDiscoveryCommandFactory();
            var cmd = factory.BuildExact(disco);

            var structs = cmd.Execute();

            Assert.That(structs.Count(), Is.EqualTo(3));
        }
        public void GetPartialMetadata_CalendarHierarchyWithSixLevels_ListStructureContainingSixElements()
        {
            var disco = new DiscoveryRequestFactory().BuildDirect(
                ConnectionStringReader.GetAdomd(),
                DiscoveryTarget.Levels,
                new List<IFilter>() {
                    new CaptionFilter("Adventure Works", DiscoveryTarget.Perspectives),
                    new CaptionFilter("Date", DiscoveryTarget.Dimensions),
                    new CaptionFilter("Calendar", DiscoveryTarget.Hierarchies)
                });

            var factory = new AdomdDiscoveryCommandFactory();
            var cmd = factory.BuildExact(disco);

            var structs = cmd.Execute();

            Assert.That(structs.Count(), Is.EqualTo(6));
        }
        public void GetPartialMetadata_TabularMonthLevelWithTwoProperties_ListStructureContainingNoElement()
        {
            var disco = new DiscoveryRequestFactory().BuildDirect(
                ConnectionStringReader.GetAdomdTabular(),
                DiscoveryTarget.Properties,
                new List<IFilter>() {
                    new CaptionFilter("Internet Operations", DiscoveryTarget.Perspectives),
                    new CaptionFilter("Date", DiscoveryTarget.Dimensions),
                    new CaptionFilter("Calendar", DiscoveryTarget.Hierarchies),
                    new CaptionFilter("Month", DiscoveryTarget.Levels)
                });

            var factory = new AdomdDiscoveryCommandFactory();
            var cmd = factory.BuildExact(disco);

            var structs = cmd.Execute();

            Assert.That(structs.Count(), Is.EqualTo(0));
        }