Skip to content

Commit b7352de

Browse files
Adapt TestAsyncConsumerExceptions test for 6.x
1 parent d976754 commit b7352de

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

projects/Unit/TestAsyncConsumerExceptions.cs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -47,18 +47,18 @@ protected void TestExceptionHandlingWith(IBasicConsumer consumer,
4747
{
4848
var resetEvent = new AutoResetEvent(false);
4949
bool notified = false;
50-
string q = _model.QueueDeclare();
50+
string q = this.Model.QueueDeclare();
5151

52-
_model.CallbackException += (m, evt) =>
52+
this.Model.CallbackException += (m, evt) =>
5353
{
5454
if (evt.Exception != TestException) return;
5555

5656
notified = true;
5757
resetEvent.Set();
5858
};
5959

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);
6262
resetEvent.WaitOne();
6363

6464
Assert.IsTrue(notified);
@@ -67,48 +67,48 @@ protected void TestExceptionHandlingWith(IBasicConsumer consumer,
6767
[SetUp]
6868
public override void Init()
6969
{
70-
_connFactory = new ConnectionFactory
70+
ConnFactory = new ConnectionFactory
7171
{
7272
DispatchConsumersAsync = true
7373
};
7474

75-
_conn = _connFactory.CreateConnection();
76-
_model = _conn.CreateModel();
75+
Conn = ConnFactory.CreateConnection();
76+
Model = Conn.CreateModel();
7777
}
7878

7979
[Test]
8080
public void TestCancelNotificationExceptionHandling()
8181
{
82-
IBasicConsumer consumer = new ConsumerFailingOnCancel(_model);
82+
IBasicConsumer consumer = new ConsumerFailingOnCancel(this.Model);
8383
TestExceptionHandlingWith(consumer, (m, q, c, ct) => m.QueueDelete(q));
8484
}
8585

8686
[Test]
8787
public void TestConsumerCancelOkExceptionHandling()
8888
{
89-
IBasicConsumer consumer = new ConsumerFailingOnCancelOk(_model);
89+
IBasicConsumer consumer = new ConsumerFailingOnCancelOk(this.Model);
9090
TestExceptionHandlingWith(consumer, (m, q, c, ct) => m.BasicCancel(ct));
9191
}
9292

9393
[Test]
9494
public void TestConsumerConsumeOkExceptionHandling()
9595
{
96-
IBasicConsumer consumer = new ConsumerFailingOnConsumeOk(_model);
96+
IBasicConsumer consumer = new ConsumerFailingOnConsumeOk(this.Model);
9797
TestExceptionHandlingWith(consumer, (m, q, c, ct) => { });
9898
}
9999

100100
[Test]
101101
public void TestConsumerShutdownExceptionHandling()
102102
{
103-
IBasicConsumer consumer = new ConsumerFailingOnShutdown(_model);
103+
IBasicConsumer consumer = new ConsumerFailingOnShutdown(this.Model);
104104
TestExceptionHandlingWith(consumer, (m, q, c, ct) => m.Close());
105105
}
106106

107107
[Test]
108108
public void TestDeliveryExceptionHandling()
109109
{
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")));
112112
}
113113

114114
private class ConsumerFailingOnDelivery : AsyncEventingBasicConsumer

0 commit comments

Comments
 (0)