This commit is contained in:
Jan Eggers
2019-07-09 14:15:46 +02:00
parent 6608172719
commit 4f66614cdd
5 changed files with 82 additions and 6 deletions
@@ -47,5 +47,21 @@ namespace MQTTnet.AspNetCore.Tests
await Task.WhenAll(tasks).ConfigureAwait(false);
}
[TestMethod]
public async Task TestLargePacket()
{
var serializer = new MqttPacketFormatterAdapter(MqttProtocolVersion.V311);
var pipe = new DuplexPipeMockup();
var connection = new DefaultConnectionContext();
connection.Transport = pipe;
var ctx = new MqttConnectionContext(serializer, connection);
await ctx.SendPacketAsync(new MqttPublishPacket() { Payload = new byte[20_000] }, TimeSpan.Zero, CancellationToken.None).ConfigureAwait(false);
var readResult = await pipe.Send.Reader.ReadAsync();
Assert.IsTrue(readResult.Buffer.Length > 20000);
}
}
}