Esempio n. 1
0
        public void GetOrchestration_NoConfiguration()
        {
            var configuration = Substitute.For <IOrchestrationConfiguration>();

            configuration.Orchestrations.Returns(new Dictionary <Type, IOrchestrationSettings>());

            var dispatcher = new ProviderCommandDispatchActivity(configuration);
            var command    = new TestCommand();

            Assert.Throws <NotSupportedException>(() => dispatcher.RunActivity(command));
        }
Esempio n. 2
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);
        }
Esempio n. 3
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);
        }