Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit c163350

Browse files
authored
Allow Schema queue to be detected from the database schema instead of hardcoding the username (#27142)
1 parent 647ab15 commit c163350

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

src/System.Data.SqlClient/tests/ManualTests/SQL/SqlNotificationTest/SqlNotificationTest.cs

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ public class SqlNotificationTest : IDisposable
1313
private const int CALLBACK_TIMEOUT = 5000; // milliseconds
1414

1515
// Database schema
16-
private readonly string _tableName = "dbo.[SQLDEP_" + Guid.NewGuid().ToString() + "]";
17-
private readonly string _queueName = "SQLDEP_" + Guid.NewGuid().ToString();
18-
private readonly string _serviceName = "SQLDEP_" + Guid.NewGuid().ToString();
16+
private readonly string _tableName = $"dbo.[SQLDEP_{Guid.NewGuid().ToString()}]";
17+
private readonly string _queueName = $"SQLDEP_{Guid.NewGuid().ToString()}";
18+
private readonly string _serviceName = $"SQLDEP_{Guid.NewGuid().ToString()}";
1919
private readonly string _schemaQueue;
2020

2121
// Connection information used by all tests
@@ -27,15 +27,7 @@ public SqlNotificationTest()
2727
_startConnectionString = DataTestUtility.TcpConnStr;
2828
_execConnectionString = DataTestUtility.TcpConnStr;
2929

30-
var startBuilder = new SqlConnectionStringBuilder(_startConnectionString);
31-
if (startBuilder.IntegratedSecurity)
32-
{
33-
_schemaQueue = string.Format("[{0}]", _queueName);
34-
}
35-
else
36-
{
37-
_schemaQueue = string.Format("[{0}].[{1}]", startBuilder.UserID, _queueName);
38-
}
30+
_schemaQueue = $"[{_queueName}]";
3931

4032
Setup();
4133
}

0 commit comments

Comments
 (0)