public void MqManagerTest_Publish() { try { Assert.DoesNotThrow(() => { mqManager.PublishMessage("helloRabbit"); }); } finally { mqManager.DeleteQueues(); mqManager.DeleteExchange(exchangeName); } }
public void MessageController_Load() { try { var state = new StateMessage { MeasureUnit = 1, Message = "OK", MeterDt = DateTime.Now, State = 1, Volume = 200 }; var meterMess = new MeterMessage { Id = 1, Address = 234, Env = 0, Maker = "lora", SerialNumber = 1, SetupIdentity = 243, Body = state }; var hubMess = new HubMessage { HubId = 1, Messages = new System.Collections.Generic.List <MeterMessage> { meterMess } }; Assert.DoesNotThrow(() => { _messageController.Load(hubMess); }); } finally { _mqManager.DeleteQueues(); _mqManager.DeleteExchange(_exchangeName); } }