예제 #1
0
        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));
        }
예제 #2
0
        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"));
        }
예제 #3
0
        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"));
        }
        protected IEnumerable<string> GetMembersFromDiscoveryRequest(MembersDiscoveryRequest disco)
        {
            var engine = new MembersAdomdEngine();
            var results = engine.GetMembers(disco);

            var members = results.ToCaptions();
            return members;
        }
예제 #5
0
        public void GetMembers_ByHierarchy_ReturnListMembersWithCorrectOrdinal()
        {
            //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));
            Assert.That(List.Map(actual).Property("Ordinal"), Is.Unique);
            Assert.That(List.Map(actual).Property("Ordinal"), Has.All.GreaterThanOrEqualTo(0));
        }
예제 #6
0
        public void GetMembers_ByLevel_ReturnListMembersWithCorrectUniqueName()
        {
            //Buiding object used during test
            var mae = new MembersAdomdEngine();
            var disco = new DiscoveryRequestFactory().Build(
                ConnectionStringReader.GetAdomd(),
                string.Empty,
                "Adventure Works",
                "Geography",
                "Geography",
                "Country"
                );

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

            //Assertion
            Assert.That(List.Map(actual).Property("UniqueName"), Has.Member("[Geography].[Geography].[Country].&[Canada]"));
            Assert.That(List.Map(actual).Property("UniqueName"), Has.Member("[Geography].[Geography].[Country].&[France]"));
        }
예제 #7
0
        public void GetMembers_ByLevel_ReturnListMembersWithCorrectLevelNumber()
        {
            var mae = new MembersAdomdEngine();
            var disco = new DiscoveryRequestFactory().Build(
                ConnectionStringReader.GetAdomd(),
                string.Empty,
                "Adventure Works",
                "Geography",
                "Geography",
                "Country"
                );

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

            //Assertion
            Assert.That(List.Map(actual).Property("LevelNumber"), Has.All.EqualTo(1));
        }