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