Esempio n. 1
0
        public void Constructor_SetsQueuesCI()
        {
            var serviceBusBuilder = new ServiceBusBuilder(Substitute.For <ISimulation>());

            serviceBusBuilder.AddQueue(new Queue("One"));
            serviceBusBuilder.AddQueue(new Queue("two"));

            var simulator = new ServiceBusSimulator(serviceBusBuilder);

            simulator.ShouldSatisfyAllConditions(
                () => simulator.Queues.Count.ShouldBe(2),
                () => simulator.Queues["one"].Name.ShouldBe("One"),
                () => simulator.Queues["tWO"].Name.ShouldBe("two")
                );
        }
Esempio n. 2
0
        public void Constructor_SetsTopicsCI()
        {
            var serviceBusBuilder = new ServiceBusBuilder(Substitute.For <ISimulation>());

            serviceBusBuilder.AddTopic(new Topic("xyz", new Subscription("a"), new Subscription("b")));
            serviceBusBuilder.AddTopic(new Topic("V"));

            var simulator = new ServiceBusSimulator(serviceBusBuilder);

            simulator.ShouldSatisfyAllConditions(
                () => simulator.Topics.Count.ShouldBe(2),
                () => simulator.Topics["XYZ"].Subscriptions.Count.ShouldBe(2),
                () => simulator.Topics["xyz"].Subscriptions["A"].Name.ShouldBe("a"),
                () => simulator.Topics["xYz"].Subscriptions["b"].Name.ShouldBe("b"),
                () => simulator.Topics["v"].Subscriptions.ShouldBeEmpty(),
                () => simulator.Topics["v"].Name.ShouldBe("V")
                );
        }