Exemple #1
0
        public void throws_expected_exception_when_no_topic_is_registered_for_an_event_type()
        {
            var stubEventTypeName = "foo";
            var sut = new DomainEventRegistryBuilder().Build();

            Assert.Throws <MessagingException>(() => sut.GetTopicFor(stubEventTypeName));
        }
Exemple #2
0
        public void returns_expected_topic()
        {
            var stubRegistration = new DomainEventRegistrationBuilder()
                                   .WithEventInstanceType <FooDomainEvent>()
                                   .Build();

            var sut = new DomainEventRegistryBuilder().Build();

            sut.Register <FooDomainEvent>(stubRegistration.EventType, stubRegistration.Topic);

            var result = sut.GetTopicFor(stubRegistration.EventType);

            Assert.Equal(
                expected: stubRegistration.Topic,
                actual: result
                );
        }