public void EventEmitterShouldNotEmitAnEventToAnUnregisteredPusherEventGeneralListener()
        {
            // Arrange
            Tuple <string, PusherEvent> emittedEvent = null;

            var myAction = new Action <string, PusherEvent>((e, o) => emittedEvent = new Tuple <string, PusherEvent>(e, o));

            var emitter = new PusherClient.EventEmitter();

            emitter.BindAll(myAction);
            emitter.UnbindAll();

            // Act
            emitter.EmitEvent("pusher event general listener event", CreateTestEvent());

            // Assert
            Assert.IsNull(emittedEvent);
        }
        public void EventEmitterShouldEmitAnEventToARegisteredRawGeneralListener()
        {
            // Arrange
            Tuple <string, string> emittedEvent = null;

            var myAction = new Action <string, string>((e, o) => emittedEvent = new Tuple <string, string>(e, o));

            var emitter = new PusherClient.EventEmitter();

            emitter.BindAll(myAction);

            // Act
            emitter.EmitEvent("raw general listener event", CreateTestEvent());

            // Assert
            Assert.IsNotNull(emittedEvent);
            StringAssert.AreEqualIgnoringCase("raw general listener event", emittedEvent.Item1);
            StringAssert.AreEqualIgnoringCase("{\"user_id\":\"a user\",\"channel\":\"a channel name\",\"event\":\"channel event\",\"data\":\"{\\\"stuff\\\":1234}\"}", emittedEvent.Item2);
        }
        public void EventEmitterShouldEmitAnEventToARegisteredGeneralListener()
        {
            // Arrange
            Tuple <string, dynamic> emittedEvent = null;

            var myAction = new Action <string, dynamic>((e, o) => emittedEvent = new Tuple <string, dynamic>(e, o));

            var emitter = new PusherClient.EventEmitter();

            emitter.BindAll(myAction);

            // Act
            emitter.EmitEvent("general listener event", CreateTestEvent());

            // Assert
            Assert.IsNotNull(emittedEvent);
            StringAssert.AreEqualIgnoringCase("general listener event", emittedEvent.Item1);
            StringAssert.AreEqualIgnoringCase("channel event", [email protected]);
        }