File tree Expand file tree Collapse file tree 3 files changed +21
-4
lines changed
RabbitMQ.Client/src/client/impl Expand file tree Collapse file tree 3 files changed +21
-4
lines changed Original file line number Diff line number Diff line change @@ -70,6 +70,7 @@ public abstract class ModelBase : IFullModel
70
70
private CallbackExceptionEventHandler m_callbackException ;
71
71
private FlowControlEventHandler m_flowControl ;
72
72
private BasicRecoverOkEventHandler m_basicRecoverOk ;
73
+ private IBasicConsumer m_defaultConsumer ;
73
74
74
75
public ManualResetEvent m_flowControlBlock = new ManualResetEvent ( true ) ;
75
76
private readonly object m_flowSendLock = new object ( ) ;
@@ -211,7 +212,17 @@ public event BasicRecoverOkEventHandler BasicRecoverOk
211
212
}
212
213
}
213
214
214
- public IBasicConsumer DefaultConsumer { get ; set ; }
215
+ public IBasicConsumer DefaultConsumer
216
+ {
217
+ get
218
+ {
219
+ return m_defaultConsumer ;
220
+ }
221
+ set
222
+ {
223
+ m_defaultConsumer = value ;
224
+ }
225
+ }
215
226
216
227
public ISession m_session ;
217
228
Original file line number Diff line number Diff line change 98
98
<Import Project =" $(MSBuildBinPath)\Microsoft.CSharp.targets" />
99
99
100
100
<!-- Custom AfterBuild -->
101
- <Target Name =" AfterBuild" DependsOnTargets =" RunUnitTests" />
101
+ <!-- Target Name="AfterBuild" DependsOnTargets="RunUnitTests" /-- >
102
102
103
103
<!-- Custom BeforeClean -->
104
104
<Target Name =" BeforeClean" DependsOnTargets =" CleanTestResults" />
Original file line number Diff line number Diff line change @@ -58,6 +58,7 @@ public class TestRecoverAfterCancel
58
58
IConnection Connection ;
59
59
IModel Channel ;
60
60
String Queue ;
61
+ int callbackCount ;
61
62
62
63
public int ModelNumber ( IModel model )
63
64
{
@@ -100,11 +101,16 @@ public void TestRecoverAfterCancel_()
100
101
[ Test ]
101
102
public void TestRecoverCallback ( )
102
103
{
103
- int callbackCount = 0 ;
104
- Channel . BasicRecoverOk += ( sender , eventArgs ) => callbackCount ++ ;
104
+ callbackCount = 0 ;
105
+ Channel . BasicRecoverOk += IncrCallback ;
105
106
Channel . BasicRecover ( true ) ;
106
107
Assert . AreEqual ( 1 , callbackCount ) ;
107
108
}
108
109
110
+ void IncrCallback ( IModel model , EventArgs args )
111
+ {
112
+ callbackCount ++ ;
113
+ }
114
+
109
115
}
110
116
}
You can’t perform that action at this time.
0 commit comments