Exemple #1
0
        public void Autosubscribe_AttributeEnvelope()
        {
            using (var wait = new ManualResetEvent(false))
            {
                var target = new MessageBus();
                var obj    = new TestClass9(wait);
                var token  = target.AutoWireupSubscribers(obj);

                target.Publish("test");
                wait.WaitOne(2000).Should().Be(true);
            }
        }
Exemple #2
0
        public void Autosubscribe_GenericClass()
        {
            using (var wait = new ManualResetEvent(false))
            {
                var target = new MessageBus();
                var obj    = new TestClass7 <string>(wait);
                var token  = target.AutoWireupSubscribers(obj);

                target.Publish("test");
                wait.WaitOne(2000).Should().Be(true);
                obj.Value.Should().Be("test");
            }
        }
Exemple #3
0
        public void Autosubscribe_Topics()
        {
            using (var wait = new ManualResetEvent(false))
            {
                var target = new MessageBus();
                var obj    = new TestClass2(wait);
                var token  = target.AutoWireupSubscribers(obj);

                target.Publish("A", "test1");
                target.Publish("B", "test2");
                target.Publish("C", "test3");
                wait.WaitOne(2000).Should().Be(true);
                obj.Value.Should().Be("test2");
            }
        }