Merge branch 'master' of https://github.com/Azure/amqpnetlite into nanoframework-dev
This commit is contained in:
Коммит
e7f2384183
|
@ -262,12 +262,24 @@ namespace Test.Amqp
|
|||
Assert.IsTrue(message != null);
|
||||
receiver.Accept(message);
|
||||
}
|
||||
|
||||
bool gotMessage = true;
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
messages.Enqueue(new Message("test") { Properties = new Properties() { MessageId = name + count } });
|
||||
var message = receiver.Receive(TimeSpan.FromMilliseconds(500));
|
||||
Assert.IsTrue(message == null);
|
||||
if (message == null)
|
||||
{
|
||||
gotMessage = false;
|
||||
break;
|
||||
}
|
||||
|
||||
receiver.Accept(message);
|
||||
Thread.Sleep(1000);
|
||||
}
|
||||
|
||||
Assert.IsTrue(!gotMessage, "Message should not be returned.");
|
||||
|
||||
receiver.Close();
|
||||
session.Close();
|
||||
connection.Close();
|
||||
|
|
|
@ -130,8 +130,12 @@ namespace Test.Amqp
|
|||
Assert.AreEqual(ConnectionState.End, connection.ConnectionState);
|
||||
try
|
||||
{
|
||||
Thread.Sleep(300);
|
||||
networkStream.WriteByte(0);
|
||||
for (int i = 0; i < 20; i++)
|
||||
{
|
||||
networkStream.WriteByte(0);
|
||||
Thread.Sleep(100);
|
||||
}
|
||||
|
||||
Assert.IsTrue(false, "transport connection not closed");
|
||||
}
|
||||
catch (IOException) { }
|
||||
|
@ -156,7 +160,12 @@ namespace Test.Amqp
|
|||
Assert.AreEqual((Symbol)ErrorCode.InvalidField, connection.Error.Condition);
|
||||
try
|
||||
{
|
||||
networkStream.WriteByte(0);
|
||||
for (int i = 0; i < 20; i++)
|
||||
{
|
||||
networkStream.WriteByte(0);
|
||||
Thread.Sleep(100);
|
||||
}
|
||||
|
||||
Assert.IsTrue(false, "transport connection not closed");
|
||||
}
|
||||
catch (IOException) { }
|
||||
|
|
Загрузка…
Ссылка в новой задаче