Beispiel #1
0
        public void GetOrchestration_Inherited_Ignored()
        {
            var configuration = Substitute.For <IOrchestrationConfiguration>();

            configuration.Ignored.Returns(new List <Type>()
            {
                typeof(TestCommand)
            });

            var dispatcher    = new ProviderCommandDispatchActivity(configuration);
            var command       = new TestInheritedCommand();
            var orchestration = dispatcher.RunActivity(command);

            Assert.Null(orchestration);
        }
Beispiel #2
0
        public void GetOrchestration_Inherited_Match()
        {
            var settings = Substitute.For <IOrchestrationSettings>();

            settings.OrchestrationName.Returns(nameof(TestCommandOrchestration));

            var configuration = Substitute.For <IOrchestrationConfiguration>();

            configuration.Orchestrations.Returns(new Dictionary <Type, IOrchestrationSettings>()
            {
                { typeof(TestCommand), settings }
            });

            var dispatcher    = new ProviderCommandDispatchActivity(configuration);
            var command       = new TestInheritedCommand();
            var orchestration = dispatcher.RunActivity(command);

            Assert.Equal(nameof(TestCommandOrchestration), orchestration);
        }