コード例 #1
0
            public void AddEvent_Test()
            {
                IEventManager eventManager = new QueueEventManager();
                string        streamName   = "test stream";

                Event expectedEvent = new Event(streamName, "test data", "test auth");

                eventManager.addEvent(expectedEvent);

                Event resultEvent = eventManager.getEvent(streamName);

                Assert.AreEqual(expectedEvent.stream_, resultEvent.stream_);
                Assert.AreEqual(expectedEvent.data_, resultEvent.data_);
                Assert.AreEqual(expectedEvent.authKey_, resultEvent.authKey_);
            }
コード例 #2
0
ファイル: HorseMq.cs プロジェクト: erkantaylan/horse-mq
        /// <summary>
        /// Creates new Messaging Queue Server
        /// </summary>
        public HorseMq(HorseMqOptions options)
        {
            Options = options ?? new HorseMqOptions();

            _routers = new SafeList <IRouter>(256);
            _queues  = new SafeList <HorseQueue>(256);
            _clients = new SafeList <MqClient>(2048);

            NodeManager = new NodeManager(this);

            NodeManager.Initialize();

            OnClientConnected    = new ClientEventManager(EventNames.ClientConnected, this);
            OnClientDisconnected = new ClientEventManager(EventNames.ClientDisconnected, this);
            OnQueueCreated       = new QueueEventManager(this, EventNames.QueueCreated);
            OnQueueUpdated       = new QueueEventManager(this, EventNames.QueueUpdated);
            OnQueueRemoved       = new QueueEventManager(this, EventNames.QueueRemoved);
        }
コード例 #3
0
            public void Constructor_Test()
            {
                IEventManager eventManager = new QueueEventManager();

                Assert.AreEqual(eventManager.getEvent(""), null);
            }