diff --git a/Build/MQTTnet.nuspec b/Build/MQTTnet.nuspec index 5fdc919..62630c1 100644 --- a/Build/MQTTnet.nuspec +++ b/Build/MQTTnet.nuspec @@ -2,7 +2,7 @@ MQTTnet - 2.5.0 + 2.5.1 Christian Kratky Christian Kratky https://github.com/chkr1011/MQTTnet/blob/master/LICENSE @@ -10,22 +10,7 @@ https://raw.githubusercontent.com/chkr1011/MQTTnet/master/Images/Logo_128x128.png false MQTTnet is a high performance .NET library for MQTT based communication. It provides a MQTT client and a MQTT server (broker). - * [Core] Merged the platform specific projects (Thanks to @JanEggers) -* [Core] Migrated the trace to a non-static approach (Breaking Change!) -* [Core] Added a builder for application messages using a fluent API -* [Core] Introduced CI and DI (Thanks to @JanEggers) -* [Core] Added interfaces for publishing and receiving which applies to every client and server (Thanks to @ChristianRiedl) -* [Core] Fixed an issue when reading from closed streams -* [Client] Added a first version of a managed client which will manage the connection, subscription etc. automatically (Thanks to @JTrotta) -* [Client] The session state response from the server is now returned in the _ConnectAsync_ method and also part of the _Connected_ event args -* [Client] Added a _TopicFilterBuilder_ using a fluent API (Namespace Changes!) -* [Client] Added several new options for the WebSocket channel (Thanks to @ChristianRiedl) -* [Client] Refactored the options and added a builder using a fluent API (Breaking Change!) -* [Client] Added more options for WebSocket connections like RequestHeaders, SubProtocol etc. -* [Server] Added support for WebSockets via ASP.NET Core 2.0 (additional nuget) (Thanks to @ChristianRiedl, @JanEggers) -* [Server] Added support for a custom application message interceptor -* [Server] Fixed an issue with dropped connections on UWP (Thanks to @haeberle) -* [Server] Added support for a custom subscription interceptor which allows denying of subscriptions and closing the connection + * Copyright Christian Kratky 2016-2017 MQTT Message Queue Telemetry Transport MQTTClient MQTTServer Server MQTTBroker Broker NETStandard IoT InternetOfThings Messaging Hardware Arduino Sensor Actuator M2M ESP Smart Home Cities Automation Xamarin diff --git a/Tests/MQTTnet.Core.Tests/MqttServerTests.cs b/Tests/MQTTnet.Core.Tests/MqttServerTests.cs index b709835..fa826c5 100644 --- a/Tests/MQTTnet.Core.Tests/MqttServerTests.cs +++ b/Tests/MQTTnet.Core.Tests/MqttServerTests.cs @@ -53,6 +53,7 @@ namespace MQTTnet.Core.Tests public async Task MqttServer_WillMessage() { var serverAdapter = new TestMqttServerAdapter(); + var services = new ServiceCollection() .AddLogging() .AddMqttServer() @@ -70,7 +71,7 @@ namespace MQTTnet.Core.Tests var c2 = await serverAdapter.ConnectTestClient(s, "c2", willMessage); c1.ApplicationMessageReceived += (_, __) => receivedMessagesCount++; - await c1.SubscribeAsync(new TopicFilter("#", MqttQualityOfServiceLevel.AtMostOnce)); + await c1.SubscribeAsync(new TopicFilter("#")); await c2.DisconnectAsync(); @@ -80,6 +81,7 @@ namespace MQTTnet.Core.Tests { await s.StopAsync(); } + Assert.AreEqual(1, receivedMessagesCount); } diff --git a/Tests/MQTTnet.Core.Tests/TestMqttCommunicationAdapter.cs b/Tests/MQTTnet.Core.Tests/TestMqttCommunicationAdapter.cs index 9e71f8a..ecde0f1 100644 --- a/Tests/MQTTnet.Core.Tests/TestMqttCommunicationAdapter.cs +++ b/Tests/MQTTnet.Core.Tests/TestMqttCommunicationAdapter.cs @@ -33,7 +33,7 @@ namespace MQTTnet.Core.Tests foreach (var packet in packets) { - Partner.SendPacketInternal(packet); + Partner.EnqueuePacketInternal(packet); } return Task.FromResult(0); @@ -46,7 +46,7 @@ namespace MQTTnet.Core.Tests return Task.Run(() => _incomingPackets.Take(), cancellationToken); } - private void SendPacketInternal(MqttBasePacket packet) + private void EnqueuePacketInternal(MqttBasePacket packet) { if (packet == null) throw new ArgumentNullException(nameof(packet)); diff --git a/Tests/MQTTnet.Core.Tests/MqttCommunicationAdapterFactory.cs b/Tests/MQTTnet.Core.Tests/TestMqttCommunicationAdapterFactory.cs similarity index 76% rename from Tests/MQTTnet.Core.Tests/MqttCommunicationAdapterFactory.cs rename to Tests/MQTTnet.Core.Tests/TestMqttCommunicationAdapterFactory.cs index 0e56411..4a0acad 100644 --- a/Tests/MQTTnet.Core.Tests/MqttCommunicationAdapterFactory.cs +++ b/Tests/MQTTnet.Core.Tests/TestMqttCommunicationAdapterFactory.cs @@ -4,11 +4,11 @@ using MQTTnet.Core.Client; namespace MQTTnet.Core.Tests { - public class MqttCommunicationAdapterFactory : IMqttCommunicationAdapterFactory + public class TestMqttCommunicationAdapterFactory : IMqttCommunicationAdapterFactory { private readonly IMqttCommunicationAdapter _adapter; - public MqttCommunicationAdapterFactory(IMqttCommunicationAdapter adapter) + public TestMqttCommunicationAdapterFactory(IMqttCommunicationAdapter adapter) { _adapter = adapter; } diff --git a/Tests/MQTTnet.Core.Tests/TestMqttServerAdapter.cs b/Tests/MQTTnet.Core.Tests/TestMqttServerAdapter.cs index 067d08f..cac3b1c 100644 --- a/Tests/MQTTnet.Core.Tests/TestMqttServerAdapter.cs +++ b/Tests/MQTTnet.Core.Tests/TestMqttServerAdapter.cs @@ -17,7 +17,11 @@ namespace MQTTnet.Core.Tests adapterA.Partner = adapterB; adapterB.Partner = adapterA; - var client = new MqttClient(new MqttCommunicationAdapterFactory(adapterA), new TestLogger(), new MqttPacketDispatcher(new TestLogger())); + var client = new MqttClient( + new TestMqttCommunicationAdapterFactory(adapterA), + new TestLogger(), + new MqttPacketDispatcher(new TestLogger())); + var connected = WaitForClientToConnect(server, clientId); FireClientAcceptedEvent(adapterB); @@ -29,8 +33,6 @@ namespace MQTTnet.Core.Tests ChannelOptions = new MqttClientTcpOptions() }; - options.ChannelOptions = new MqttClientTcpOptions(); - await client.ConnectAsync(options); await connected;