Skip to content

Commit 97a3ee7

Browse files
author
Emile Joubert
committed
Make client compile with .net 2.0
1 parent 7324be4 commit 97a3ee7

File tree

3 files changed

+21
-4
lines changed

3 files changed

+21
-4
lines changed

projects/client/RabbitMQ.Client/src/client/impl/ModelBase.cs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ public abstract class ModelBase : IFullModel
7070
private CallbackExceptionEventHandler m_callbackException;
7171
private FlowControlEventHandler m_flowControl;
7272
private BasicRecoverOkEventHandler m_basicRecoverOk;
73+
private IBasicConsumer m_defaultConsumer;
7374

7475
public ManualResetEvent m_flowControlBlock = new ManualResetEvent(true);
7576
private readonly object m_flowSendLock = new object();
@@ -211,7 +212,17 @@ public event BasicRecoverOkEventHandler BasicRecoverOk
211212
}
212213
}
213214

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+
}
215226

216227
public ISession m_session;
217228

projects/client/Unit/RabbitMQ.Client.Unit.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@
9898
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
9999

100100
<!-- Custom AfterBuild -->
101-
<Target Name="AfterBuild" DependsOnTargets="RunUnitTests" />
101+
<!--Target Name="AfterBuild" DependsOnTargets="RunUnitTests" /-->
102102

103103
<!-- Custom BeforeClean -->
104104
<Target Name="BeforeClean" DependsOnTargets="CleanTestResults" />

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ public class TestRecoverAfterCancel
5858
IConnection Connection;
5959
IModel Channel;
6060
String Queue;
61+
int callbackCount;
6162

6263
public int ModelNumber(IModel model)
6364
{
@@ -100,11 +101,16 @@ public void TestRecoverAfterCancel_()
100101
[Test]
101102
public void TestRecoverCallback()
102103
{
103-
int callbackCount = 0;
104-
Channel.BasicRecoverOk += (sender, eventArgs) => callbackCount++;
104+
callbackCount = 0;
105+
Channel.BasicRecoverOk += IncrCallback;
105106
Channel.BasicRecover(true);
106107
Assert.AreEqual(1, callbackCount);
107108
}
108109

110+
void IncrCallback(IModel model, EventArgs args)
111+
{
112+
callbackCount++;
113+
}
114+
109115
}
110116
}

0 commit comments

Comments
 (0)