mirror of
https://github.com/dotnet/MQTTnet.git
synced 2026-10-21 04:03:05 +08:00
Update UnitTests.
This commit is contained in:
@@ -36,7 +36,10 @@ namespace MQTTnet.Tests.MQTTv5
|
|||||||
.WithWillDelayInterval(20)
|
.WithWillDelayInterval(20)
|
||||||
.Build());
|
.Build());
|
||||||
|
|
||||||
|
MqttApplicationMessage receivedMessage = null;
|
||||||
|
|
||||||
await client.SubscribeAsync("a");
|
await client.SubscribeAsync("a");
|
||||||
|
client.UseApplicationMessageReceivedHandler(context => { receivedMessage = context.ApplicationMessage; });
|
||||||
|
|
||||||
await client.PublishAsync(new MqttApplicationMessageBuilder()
|
await client.PublishAsync(new MqttApplicationMessageBuilder()
|
||||||
.WithTopic("a")
|
.WithTopic("a")
|
||||||
@@ -48,6 +51,10 @@ namespace MQTTnet.Tests.MQTTv5
|
|||||||
.Build());
|
.Build());
|
||||||
|
|
||||||
await Task.Delay(500);
|
await Task.Delay(500);
|
||||||
|
|
||||||
|
Assert.IsNotNull(receivedMessage);
|
||||||
|
|
||||||
|
Assert.AreEqual(2, receivedMessage.UserProperties.Count);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user