Skip to content

Commit b3b1dd6

Browse files
author
Emile Joubert
committed
Move documentation to more relevant position and make test less racy
1 parent b034dc6 commit b3b1dd6

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

projects/client/RabbitMQ.Client/src/client/api/IModel.cs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,9 @@ public interface IModel: IDisposable
9393
///</remarks>
9494
event CallbackExceptionEventHandler CallbackException;
9595

96-
///<summary>Signalled when a RecoverOk is received from the
97-
///server. </summary>
96+
///<summary>All messages received before this fires that haven't been
97+
///ack'ed will be redelivered. All messages received afterwards won't
98+
///be.</summary>
9899
event BasicRecoverOkEventHandler BasicRecoverOk;
99100

100101
///<summary>Signalled when an unexpected message is delivered
@@ -630,10 +631,7 @@ void HandleBasicGetOk(ulong deliveryTag,
630631
void HandleBasicGetEmpty();
631632

632633
///<summary>Handle incoming Basic.RecoverOk methods
633-
///received in reply to Basic.Recover . All messages
634-
///received before this is invoked that haven't been
635-
///ack'ed will be redelivered. All messages received
636-
///afterwards won't be.
634+
///received in reply to Basic.Recover.
637635
///</summary>
638636
void HandleBasicRecoverOk();
639637

projects/client/Unit/src/unit/TestRecoverAfterCancel.cs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
using System;
6060
using System.IO;
6161
using System.Text;
62+
using System.Threading;
6263
using System.Collections;
6364

6465
using RabbitMQ.Client.Impl;
@@ -117,12 +118,13 @@ public void TestRecoverAfterCancel_()
117118
}
118119

119120
[Test]
120-
public void TestRecoverCallback()
121-
{
122-
int callbackCount = 0;
123-
Channel.BasicRecoverOk += (sender, eventArgs) => callbackCount++;
124-
Channel.BasicRecover(false);
125-
Assert.AreEqual(1, callbackCount);
121+
public void TestRecoverCallback()
122+
{
123+
int callbackCount = 0;
124+
Channel.BasicRecoverOk += (sender, eventArgs) => callbackCount++;
125+
Channel.BasicRecover(false);
126+
Thread.Sleep(100);
127+
Assert.AreEqual(1, callbackCount);
126128
}
127129

128130
}

0 commit comments

Comments
 (0)