Beispiel #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"));
        }
Beispiel #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"));
        }
Beispiel #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\".*"));
        }
Beispiel #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\".*"));
        }
Beispiel #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"));
        }
Beispiel #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"));
        }