public void Router_can_remove_routing()
        {
            router.AddSource("A", null);
            router.AddDestination("B");

            Assert.IsTrue(query.ListSources().Any(e => e.name == "A"), "Exchange not created");
            Assert.IsTrue(query.ListDestinations().Any(e => e.name == "B"), "Queue not created");

            ((RabbitRouter)router).RemoveRouting(n => true);


            Assert.IsFalse(query.ListSources().Any(e => e.name == "A"), "Exchange not cleared");
            Assert.IsFalse(query.ListDestinations().Any(e => e.name == "B"), "Queue not cleared");
        }
Esempio n. 2
0
        public void If_I_add_a_destination_twice_I_get_one_destination_and_no_errors()
        {
            router.AddDestination("B");
            router.AddDestination("B");

            Assert.That(query.ListDestinations().Count(e => e.name == "B"), Is.EqualTo(1));
        }
Esempio n. 3
0
        public void can_inspect_all_exchanges_queues_and_bindings_of_a_running_system()
        {
            _messaging.CreateDestination <IMetadataFile>("Test_Destination_1", Expires.Never);
            _messaging.CreateDestination <IMetadataFile>("Test_Destination_2", Expires.Never);

            var bindings = _query.ListBindings();

            Assert.That(bindings.Length, Is.GreaterThanOrEqualTo(6), "Too few bindings");

            var destinations = _query.ListDestinations();

            Assert.That(destinations.Length, Is.GreaterThanOrEqualTo(2), "Too few bindings");

            var sources = _query.ListSources();

            Assert.That(sources.Length, Is.GreaterThanOrEqualTo(4), "Too few exchanges");
        }