You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

23 regels
611 B

  1. using System.Collections.Generic;
  2. using System.Threading.Tasks;
  3. using MQTTnet.Server;
  4. namespace MQTTnet.Tests.Mockups
  5. {
  6. public class TestServerStorage : IMqttServerStorage
  7. {
  8. public IList<MqttApplicationMessage> Messages = new List<MqttApplicationMessage>();
  9. public Task SaveRetainedMessagesAsync(IList<MqttApplicationMessage> messages)
  10. {
  11. Messages = messages;
  12. return Task.CompletedTask;
  13. }
  14. public Task<IList<MqttApplicationMessage>> LoadRetainedMessagesAsync()
  15. {
  16. return Task.FromResult(Messages);
  17. }
  18. }
  19. }