Parcourir la source

Added UnitTests.

release/3.x.x
Christian Kratky il y a 5 ans
Parent
révision
dbb227406b
1 fichiers modifiés avec 19 ajouts et 0 suppressions
  1. +19
    -0
      Tests/MQTTnet.Core.Tests/MqttClient_Tests.cs

+ 19
- 0
Tests/MQTTnet.Core.Tests/MqttClient_Tests.cs Voir le fichier

@@ -158,6 +158,25 @@ namespace MQTTnet.Tests
}
}

[TestMethod]
public async Task Fire_Disconnected_Event_On_Server_Shutdown()
{
using (var testEnvironment = new TestEnvironment())
{
var server = await testEnvironment.StartServerAsync();
var client = await testEnvironment.ConnectClientAsync();

var handlerFired = false;
client.UseDisconnectedHandler(e => handlerFired = true);

await server.StopAsync();

await Task.Delay(4000);

Assert.IsTrue(handlerFired);
}
}

[TestMethod]
public async Task Disconnect_Event_Contains_Exception()
{


Chargement…
Annuler
Enregistrer