public Core.Interfaces.IBus CreateBusWithHosting(bool reportRaw = false) { IBus bus = new Succubus.Core.Bus(); bus.Initialize(config => { config.WithLoopback(clear: true); if (reportRaw == true) { (config.Transport as Succubus.Backend.Loopback.Transport).ReportRaw = true; } }); return bus; }
public Core.Interfaces.IBus CreateBus(bool reportRaw = false) { IBus bus = new Succubus.Core.Bus(); bus.Initialize(config => { config.WithZeroMQ(); var transport = config.Transport as Succubus.Backend.ZeroMQ.Transport; if (reportRaw == true) { transport.ReportRaw = true; } }); return bus; }
public void CheckLogging() { var bus = new Succubus.Core.Bus(); var memoryStream = new MemoryStream(); bus.Initialize(config => { config.WithLoopback(); config.Name = "TestBus"; config.LogWriter = new StreamWriter(memoryStream); config.LogLevel = Core.LogLevel.Trace; }); memoryStream.Position = 0; var sr = new StreamReader(memoryStream); var myStr = sr.ReadToEnd(); Assert.AreEqual("[Info] TestBus: Bus initialized\r\n", myStr); }