Пример #1
0
        public void TestPushEventsAppendNonInclusiveEventNotPushed() {
            var pushEndPoint = new PushEventsEndPoint() {
                InclusiveNames = new List<String>() {
                    "EventName"
                }
            };

            pushEndPoint.Append(new GenericEvent() {
                Name = "DifferentEventName",
                Message = "Yo."
            });

            Assert.AreEqual(0, pushEndPoint.EventsStream.Count);
        }
Пример #2
0
        public void TestPushEventsDisposedEventIsRemoved() {
            var pushEndPoint = new PushEventsEndPoint();

            var genericEventArgs = new GenericEvent() {
                Message = "What up?"
            };

            pushEndPoint.Append(genericEventArgs);

            genericEventArgs.Dispose();

            Assert.AreEqual(0, pushEndPoint.EventsStream.Count);
        }
Пример #3
0
        public void TestPushEventsRequestFailCleanupOccurs() {
            var requestWait = new AutoResetEvent(false);
            var pushEndPoint = new PushEventsEndPoint() {
                InclusiveNames = new List<String>() {
                    "EventName"
                }
            };

            pushEndPoint.Append(new GenericEvent() {
                Name = "EventName",
                Message = "What up?"
            });

            pushEndPoint.PushCompleted += sender => requestWait.Set();

            pushEndPoint.Push();

            Assert.IsTrue(requestWait.WaitOne(10000));
            Assert.AreEqual(0, pushEndPoint.EventsStream.Count);
        }