Exemplo n.º 1
0
        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));
        }