示例#1
0
        public void GetConnectionString_NoInitialRoleAndNoAdditionalRoleProvided_NoRoleAtTheEnd()
        {
            var item = new BaseItemTestable();
            item.ConnectionString = @"Provider=MSOLAP.4;Data Source=(local)\SQL2012;Initial Catalog='Adventure Works DW 2012';";

            var connString = item.GetConnectionString();

            Assert.That(connString, Is.Not.StringContaining("role"));
        }
示例#2
0
        public void GetConnectionString_NoInitialRoleAndNoAdditionalRoleProvided_NoRoleAtTheEnd()
        {
            var item = new BaseItemTestable();

            item.ConnectionString = @"Provider=MSOLAP.4;Data Source=(local)\SQL2012;Initial Catalog='Adventure Works DW 2012';";

            var connString = item.GetConnectionString();

            Assert.That(connString, Is.Not.StringContaining("role"));
        }
示例#3
0
        public void GetConnectionString_NoInitialRoleAndTwoAdditionalRolesProvided_TwoRolesAtTheEnd()
        {
            var item = new BaseItemTestable();
            item.ConnectionString = @"Provider=MSOLAP.4;Data Source=(local)\SQL2012;Initial Catalog='Adventure Works DW 2012';";
            item.Roles = "PowerUser;LimitedAccess";

            var connString = item.GetConnectionString();

            Assert.That(connString, Is.StringMatching(".*Roles.*=.*\"PowerUser;LimitedAccess\".*"));
        }
示例#4
0
        public void GetConnectionString_NoInitialRoleAndTwoAdditionalRolesProvided_TwoRolesAtTheEnd()
        {
            var item = new BaseItemTestable();

            item.ConnectionString = @"Provider=MSOLAP.4;Data Source=(local)\SQL2012;Initial Catalog='Adventure Works DW 2012';";
            item.Roles            = "PowerUser;LimitedAccess";

            var connString = item.GetConnectionString();

            Assert.That(connString, Is.StringMatching(".*Roles.*=.*\"PowerUser;LimitedAccess\".*"));
        }
示例#5
0
        public void GetConnectionString_OneInitialRoleAndOneAdditionalRoleProvided_OneRoleAtTheEnd()
        {
            var item = new BaseItemTestable();
            item.ConnectionString = @"Provider=MSOLAP.4;Data Source=(local)\SQL2012;Initial Catalog='Adventure Works DW 2012';";
            item.ConnectionString += "Roles=\"Admin\"";
            item.Roles = "PowerUser";

            var connString = item.GetConnectionString();

            Assert.That(connString, Is.StringMatching(".*Roles.*=.*\"PowerUser\".*"));
            Assert.That(connString, Is.Not.StringMatching("Admin"));
        }
示例#6
0
        public void GetConnectionString_OneInitialRoleAndOneAdditionalRoleProvided_OneRoleAtTheEnd()
        {
            var item = new BaseItemTestable();

            item.ConnectionString  = @"Provider=MSOLAP.4;Data Source=(local)\SQL2012;Initial Catalog='Adventure Works DW 2012';";
            item.ConnectionString += "Roles=\"Admin\"";
            item.Roles             = "PowerUser";

            var connString = item.GetConnectionString();

            Assert.That(connString, Is.StringMatching(".*Roles.*=.*\"PowerUser\".*"));
            Assert.That(connString, Is.Not.StringMatching("Admin"));
        }