fixed tests and added testcase for user property serialization

This commit is contained in:
JanEggers
2019-04-15 15:37:15 +02:00
parent 9475ccd0d8
commit 03c61ad82c
5 changed files with 51 additions and 42 deletions
@@ -60,12 +60,11 @@ namespace MQTTnet.AspNetCore
public void Write(IMqttPacketWriter propertyWriter)
{
if (propertyWriter is SpanBasedMqttPacketWriter writer)
{
GrowIfNeeded(1);
}
if (propertyWriter == null) throw new ArgumentNullException(nameof(propertyWriter));
throw new InvalidOperationException($"{nameof(propertyWriter)} must be of type {typeof(SpanBasedMqttPacketWriter).Name}");
GrowIfNeeded(propertyWriter.Length);
Write(propertyWriter.GetBuffer(), 0, propertyWriter.Length);
Commit(propertyWriter.Length);
}
public void Write(byte[] payload, int start, int length)