4242
4343using NUnit . Framework ;
4444
45- using RabbitMQ . Client . Framing ;
4645using RabbitMQ . Client . Framing . Impl ;
4746
4847namespace RabbitMQ . Client . Unit
4948{
50-
5149 public class IntegrationFixture
5250 {
5351 internal IConnectionFactory ConnFactory ;
@@ -56,6 +54,12 @@ public class IntegrationFixture
5654
5755 internal Encoding encoding = new UTF8Encoding ( ) ;
5856 public static TimeSpan RECOVERY_INTERVAL = TimeSpan . FromSeconds ( 2 ) ;
57+ protected readonly string _testDisplayName ;
58+
59+ public IntegrationFixture ( )
60+ {
61+ _testDisplayName = TestContext . CurrentContext . Test . FullName ;
62+ }
5963
6064 [ SetUp ]
6165 public virtual void Init ( )
@@ -72,6 +76,7 @@ public void Dispose()
7276 {
7377 Model . Close ( ) ;
7478 }
79+
7580 if ( Conn . IsOpen )
7681 {
7782 Conn . Close ( ) ;
@@ -106,7 +111,7 @@ internal AutorecoveringConnection CreateAutorecoveringConnection(TimeSpan interv
106111 AutomaticRecoveryEnabled = true ,
107112 NetworkRecoveryInterval = interval
108113 } ;
109- return ( AutorecoveringConnection ) cf . CreateConnection ( $ "UNIT_CONN :{ Guid . NewGuid ( ) } ") ;
114+ return ( AutorecoveringConnection ) cf . CreateConnection ( $ "{ _testDisplayName } :{ Guid . NewGuid ( ) } ") ;
110115 }
111116
112117 internal AutorecoveringConnection CreateAutorecoveringConnection ( TimeSpan interval , IList < string > hostnames )
@@ -119,7 +124,7 @@ internal AutorecoveringConnection CreateAutorecoveringConnection(TimeSpan interv
119124 RequestedConnectionTimeout = TimeSpan . FromSeconds ( 1 ) ,
120125 NetworkRecoveryInterval = interval
121126 } ;
122- return ( AutorecoveringConnection ) cf . CreateConnection ( hostnames , $ "UNIT_CONN :{ Guid . NewGuid ( ) } ") ;
127+ return ( AutorecoveringConnection ) cf . CreateConnection ( hostnames , $ "{ _testDisplayName } :{ Guid . NewGuid ( ) } ") ;
123128 }
124129
125130 internal AutorecoveringConnection CreateAutorecoveringConnection ( IList < AmqpTcpEndpoint > endpoints )
@@ -132,7 +137,7 @@ internal AutorecoveringConnection CreateAutorecoveringConnection(IList<AmqpTcpEn
132137 RequestedConnectionTimeout = TimeSpan . FromSeconds ( 1 ) ,
133138 NetworkRecoveryInterval = RECOVERY_INTERVAL
134139 } ;
135- return ( AutorecoveringConnection ) cf . CreateConnection ( endpoints , $ "UNIT_CONN :{ Guid . NewGuid ( ) } ") ;
140+ return ( AutorecoveringConnection ) cf . CreateConnection ( endpoints , $ "{ _testDisplayName } :{ Guid . NewGuid ( ) } ") ;
136141 }
137142
138143 internal AutorecoveringConnection CreateAutorecoveringConnectionWithTopologyRecoveryDisabled ( )
@@ -143,7 +148,7 @@ internal AutorecoveringConnection CreateAutorecoveringConnectionWithTopologyReco
143148 TopologyRecoveryEnabled = false ,
144149 NetworkRecoveryInterval = RECOVERY_INTERVAL
145150 } ;
146- return ( AutorecoveringConnection ) cf . CreateConnection ( $ "UNIT_CONN :{ Guid . NewGuid ( ) } ") ;
151+ return ( AutorecoveringConnection ) cf . CreateConnection ( $ "{ _testDisplayName } :{ Guid . NewGuid ( ) } ") ;
147152 }
148153
149154 internal IConnection CreateNonRecoveringConnection ( )
@@ -153,7 +158,7 @@ internal IConnection CreateNonRecoveringConnection()
153158 AutomaticRecoveryEnabled = false ,
154159 TopologyRecoveryEnabled = false
155160 } ;
156- return cf . CreateConnection ( $ "UNIT_CONN :{ Guid . NewGuid ( ) } ") ;
161+ return cf . CreateConnection ( $ "{ _testDisplayName } :{ Guid . NewGuid ( ) } ") ;
157162 }
158163
159164 internal IConnection CreateConnectionWithContinuationTimeout ( bool automaticRecoveryEnabled , TimeSpan continuationTimeout )
@@ -163,7 +168,7 @@ internal IConnection CreateConnectionWithContinuationTimeout(bool automaticRecov
163168 AutomaticRecoveryEnabled = automaticRecoveryEnabled ,
164169 ContinuationTimeout = continuationTimeout
165170 } ;
166- return cf . CreateConnection ( $ "UNIT_CONN :{ Guid . NewGuid ( ) } ") ;
171+ return cf . CreateConnection ( $ "{ _testDisplayName } :{ Guid . NewGuid ( ) } ") ;
167172 }
168173
169174 //
@@ -177,7 +182,7 @@ internal void WithTemporaryAutorecoveringConnection(Action<AutorecoveringConnect
177182 AutomaticRecoveryEnabled = true
178183 } ;
179184
180- var connection = ( AutorecoveringConnection ) factory . CreateConnection ( $ "UNIT_CONN :{ Guid . NewGuid ( ) } ") ;
185+ var connection = ( AutorecoveringConnection ) factory . CreateConnection ( $ "{ _testDisplayName } :{ Guid . NewGuid ( ) } ") ;
181186 try
182187 {
183188 action ( connection ) ;
0 commit comments