@@ -47,18 +47,18 @@ protected void TestExceptionHandlingWith(IBasicConsumer consumer,
47
47
{
48
48
var resetEvent = new AutoResetEvent ( false ) ;
49
49
bool notified = false ;
50
- string q = _model . QueueDeclare ( ) ;
50
+ string q = this . Model . QueueDeclare ( ) ;
51
51
52
- _model . CallbackException += ( m , evt ) =>
52
+ this . Model . CallbackException += ( m , evt ) =>
53
53
{
54
54
if ( evt . Exception != TestException ) return ;
55
55
56
56
notified = true ;
57
57
resetEvent . Set ( ) ;
58
58
} ;
59
59
60
- string tag = _model . BasicConsume ( q , true , consumer ) ;
61
- action ( _model , q , consumer , tag ) ;
60
+ string tag = this . Model . BasicConsume ( q , true , consumer ) ;
61
+ action ( this . Model , q , consumer , tag ) ;
62
62
resetEvent . WaitOne ( ) ;
63
63
64
64
Assert . IsTrue ( notified ) ;
@@ -67,48 +67,48 @@ protected void TestExceptionHandlingWith(IBasicConsumer consumer,
67
67
[ SetUp ]
68
68
public override void Init ( )
69
69
{
70
- _connFactory = new ConnectionFactory
70
+ ConnFactory = new ConnectionFactory
71
71
{
72
72
DispatchConsumersAsync = true
73
73
} ;
74
74
75
- _conn = _connFactory . CreateConnection ( ) ;
76
- _model = _conn . CreateModel ( ) ;
75
+ Conn = ConnFactory . CreateConnection ( ) ;
76
+ Model = Conn . CreateModel ( ) ;
77
77
}
78
78
79
79
[ Test ]
80
80
public void TestCancelNotificationExceptionHandling ( )
81
81
{
82
- IBasicConsumer consumer = new ConsumerFailingOnCancel ( _model ) ;
82
+ IBasicConsumer consumer = new ConsumerFailingOnCancel ( this . Model ) ;
83
83
TestExceptionHandlingWith ( consumer , ( m , q , c , ct ) => m . QueueDelete ( q ) ) ;
84
84
}
85
85
86
86
[ Test ]
87
87
public void TestConsumerCancelOkExceptionHandling ( )
88
88
{
89
- IBasicConsumer consumer = new ConsumerFailingOnCancelOk ( _model ) ;
89
+ IBasicConsumer consumer = new ConsumerFailingOnCancelOk ( this . Model ) ;
90
90
TestExceptionHandlingWith ( consumer , ( m , q , c , ct ) => m . BasicCancel ( ct ) ) ;
91
91
}
92
92
93
93
[ Test ]
94
94
public void TestConsumerConsumeOkExceptionHandling ( )
95
95
{
96
- IBasicConsumer consumer = new ConsumerFailingOnConsumeOk ( _model ) ;
96
+ IBasicConsumer consumer = new ConsumerFailingOnConsumeOk ( this . Model ) ;
97
97
TestExceptionHandlingWith ( consumer , ( m , q , c , ct ) => { } ) ;
98
98
}
99
99
100
100
[ Test ]
101
101
public void TestConsumerShutdownExceptionHandling ( )
102
102
{
103
- IBasicConsumer consumer = new ConsumerFailingOnShutdown ( _model ) ;
103
+ IBasicConsumer consumer = new ConsumerFailingOnShutdown ( this . Model ) ;
104
104
TestExceptionHandlingWith ( consumer , ( m , q , c , ct ) => m . Close ( ) ) ;
105
105
}
106
106
107
107
[ Test ]
108
108
public void TestDeliveryExceptionHandling ( )
109
109
{
110
- IBasicConsumer consumer = new ConsumerFailingOnDelivery ( _model ) ;
111
- TestExceptionHandlingWith ( consumer , ( m , q , c , ct ) => m . BasicPublish ( "" , q , null , _encoding . GetBytes ( "msg" ) ) ) ;
110
+ IBasicConsumer consumer = new ConsumerFailingOnDelivery ( this . Model ) ;
111
+ TestExceptionHandlingWith ( consumer , ( m , q , c , ct ) => m . BasicPublish ( "" , q , null , encoding . GetBytes ( "msg" ) ) ) ;
112
112
}
113
113
114
114
private class ConsumerFailingOnDelivery : AsyncEventingBasicConsumer
0 commit comments