public void SubscribeShouldIncrementSubscribers() { BamServer server = CreateServer(MethodBase.GetCurrentMethod().Name); ILogger logger = new TextFileLogger(); Expect.AreEqual(0, server.Subscribers.Length); server.Subscribe(logger); Expect.AreEqual(1, server.Subscribers.Length); server.Subscribe(logger); Expect.AreEqual(1, server.Subscribers.Length); // should only get added once ILogger winLogger = new WindowsLogger(); server.Subscribe(winLogger); Expect.AreEqual(2, server.Subscribers.Length); Expect.IsTrue(server.IsSubscribed(winLogger)); }
public void RegisterApp() { BamServer server = new BamServer(BamConf.Load(GetRoot())); ConsoleLogger logger = new ConsoleLogger(); logger.AddDetails = false; logger.UseColors = true; server.Subscribe(logger); AppContentResponder app = server.CreateApp(GetArgument("appName")); app.Subscribe(logger); app.Initialize(); }
public void CreateClientApplication() { BamServer server = new BamServer(BamConf.Load(GetRoot())); ConsoleLogger logger = new ConsoleLogger() { AddDetails = false, UseColors = true }; server.Subscribe(logger); AppContentResponder app = server.CreateApp(GetArgument("appName")); app.Subscribe(logger); app.Initialize(); }