Ver código fonte

Added UnitTests.

release/3.x.x
Christian Kratky 5 anos atrás
pai
commit
dbb227406b
1 arquivos alterados com 19 adições e 0 exclusões
  1. +19
    -0
      Tests/MQTTnet.Core.Tests/MqttClient_Tests.cs

+ 19
- 0
Tests/MQTTnet.Core.Tests/MqttClient_Tests.cs Ver arquivo

@@ -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()
{


Carregando…
Cancelar
Salvar