Exemplo n.º 1
0
        public void ReturnsEmptyIEnumerableIfNoProcessorsAdded()
        {
            var sut = new MessageProcessorResolver(new ServiceCollection());

            sut.Initialize();

            Assert.Empty(sut.GetMessagePreProcessors());
            Assert.Empty(sut.GetMessagePostProcessors());
        }
Exemplo n.º 2
0
        public void AddsAndRetrievesMessagePostProcessors()
        {
            var services = new ServiceCollection();

            var sut = new MessageProcessorResolver(services);

            sut.AddMessagePostProcessor <TestPostProcessor1>();
            sut.AddMessagePostProcessor <TestPostProcessor2>();
            sut.Initialize();
            var postProcessors = sut.GetMessagePostProcessors();

            Assert.Equal(2, postProcessors.Count());
            Assert.NotNull(postProcessors.First());
            Assert.IsType <TestPostProcessor1>(postProcessors.First());
        }