Ejemplo n.º 1
0
        public BootstrapperBuilder WithRepository(IDescriptorRepository repository)
        {
            Assume.IsRequired(repository, nameof(repository));

            this.repository = repository;
            return(this);
        }
        public override void Setup()
        {
            base.Setup();

            DescriptorRepository = new StubCommandDescriptorRepository();
            RunnableFactory      = new StubRunnableFactory();
            UnderTest            = new DefaultCommandCallResolver(DescriptorRepository, RunnableFactory);
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="DefaultCommandCallResolver"/> class.
        /// </summary>
        public DefaultCommandCallResolver(IDescriptorRepository descriptorRepository, IRunnableFactory runnableFactory)
        {
            Assume.NotNull(descriptorRepository, nameof(descriptorRepository));
            Assume.NotNull(runnableFactory, nameof(runnableFactory));

            DescriptorRepository = descriptorRepository;
            RunnableFactory = runnableFactory;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="DefaultCommandCallResolver"/> class.
        /// </summary>
        public DefaultCommandCallResolver(IDescriptorRepository descriptorRepository, IRunnableFactory runnableFactory)
        {
            Assume.NotNull(descriptorRepository, nameof(descriptorRepository));
            Assume.NotNull(runnableFactory, nameof(runnableFactory));

            DescriptorRepository = descriptorRepository;
            RunnableFactory      = runnableFactory;
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Initializes a new instance of the <see cref="DefaultSelectorResolver"/> class.
        /// </summary>
        public DefaultSelectorResolver(ISelectorFactory selectorFactory, IDescriptorRepository descriptorRepository, INameMatcher nameMatcher = null)
        {
            Assume.NotNull(selectorFactory, nameof(selectorFactory));
            Assume.NotNull(descriptorRepository, nameof(descriptorRepository));

            SelectorFactory      = selectorFactory;
            DescriptorRepository = descriptorRepository;
            NameMatcher          = nameMatcher ?? new EqualityNameMatcher();
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="DefaultSelectorResolver"/> class.
        /// </summary>
        public DefaultSelectorResolver(ISelectorFactory selectorFactory, IDescriptorRepository descriptorRepository, INameMatcher nameMatcher = null)
        {
            Assume.NotNull(selectorFactory, nameof(selectorFactory));
            Assume.NotNull(descriptorRepository, nameof(descriptorRepository));

            SelectorFactory = selectorFactory;
            DescriptorRepository = descriptorRepository;
            NameMatcher = nameMatcher ?? new EqualityNameMatcher();
        }
Ejemplo n.º 7
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Bootstrapper"/> class.
        /// </summary>
        public Bootstrapper(IRunnableFactory runnableFactory, IDescriptorRepository descriptorRepository, Func<Bootstrapper, ICommandDescriptorManager> commandDescriptorManager = null,
                            Func<Bootstrapper, ICommandCallResolver> commandResolver = null, Func<Bootstrapper, ISelectorFactory> selectorFactory = null,
                            Func<Bootstrapper, ISelectorResolver> selectorResolver = null, Func<Bootstrapper, IRunnableManager> runnableManager = null, Func<Bootstrapper, IExecutor> executor = null,
                            Func<Bootstrapper, IControlFlowFactory<ControlFlowBase>> controlFlowFactory = null)
        {
            Assume.NotNull(runnableFactory, nameof(runnableFactory));
            Assume.NotNull(descriptorRepository, nameof(descriptorRepository));

            RunnableFactory = runnableFactory;
            DescriptorRepository = descriptorRepository;
            CommandDescriptorManager = commandDescriptorManager.SafeInvoke(this) ?? new DefaultCommandDescriptorManager();
            CommandCallResolver = commandResolver.SafeInvoke(this) ?? new DefaultCommandCallResolver(descriptorRepository, RunnableFactory);
            SelectorFactory = selectorFactory.SafeInvoke(this) ?? new DefaultSelectorFactory();
            SelectorResolver = selectorResolver.SafeInvoke(this) ?? new DefaultSelectorResolver(SelectorFactory, DescriptorRepository);
            RunnableManager = runnableManager.SafeInvoke(this) ?? new DefaultRunnableManager();
            Executor = executor.SafeInvoke(this) ?? new StandardExecutor(RunnableManager);

            ControlFlowFactory = controlFlowFactory.SafeInvoke(this) ?? new DefaultControlFlowFactory(CommandCallResolver, SelectorResolver, Executor);
            Compiler = new CodeQueryCompiler();
        }
Ejemplo n.º 8
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Bootstrapper"/> class.
        /// </summary>
        public Bootstrapper(IRunnableFactory runnableFactory, IDescriptorRepository descriptorRepository, Func <Bootstrapper, ICommandDescriptorManager> commandDescriptorManager = null,
                            Func <Bootstrapper, ICommandCallResolver> commandResolver = null, Func <Bootstrapper, ISelectorFactory> selectorFactory = null,
                            Func <Bootstrapper, ISelectorResolver> selectorResolver   = null, Func <Bootstrapper, IRunnableManager> runnableManager = null, Func <Bootstrapper, IExecutor> executor = null,
                            Func <Bootstrapper, IControlFlowFactory <ControlFlowBase> > controlFlowFactory = null)
        {
            Assume.NotNull(runnableFactory, nameof(runnableFactory));
            Assume.NotNull(descriptorRepository, nameof(descriptorRepository));

            RunnableFactory          = runnableFactory;
            DescriptorRepository     = descriptorRepository;
            CommandDescriptorManager = commandDescriptorManager.SafeInvoke(this) ?? new DefaultCommandDescriptorManager();
            CommandCallResolver      = commandResolver.SafeInvoke(this) ?? new DefaultCommandCallResolver(descriptorRepository, RunnableFactory);
            SelectorFactory          = selectorFactory.SafeInvoke(this) ?? new DefaultSelectorFactory();
            SelectorResolver         = selectorResolver.SafeInvoke(this) ?? new DefaultSelectorResolver(SelectorFactory, DescriptorRepository);
            RunnableManager          = runnableManager.SafeInvoke(this) ?? new DefaultRunnableManager();
            Executor = executor.SafeInvoke(this) ?? new StandardExecutor(RunnableManager);

            ControlFlowFactory = controlFlowFactory.SafeInvoke(this) ?? new DefaultControlFlowFactory(CommandCallResolver, SelectorResolver, Executor);
            Compiler           = new CodeQueryCompiler();
        }
        public override void Setup()
        {
            base.Setup();

            DescriptorRepository = new StubCommandDescriptorRepository();
            RunnableFactory = new StubRunnableFactory();
            UnderTest = new DefaultCommandCallResolver(DescriptorRepository, RunnableFactory);
        }
 public override void Setup()
 {
     base.Setup();
     underTest = new AutoCommandDescriptorRepository(Array(typeof(TestRunnable)));
 }
Ejemplo n.º 11
0
        public BootstrapperBuilder WithRepository(IDescriptorRepository repository)
        {
            Assume.IsRequired(repository, nameof(repository));

            this.repository = repository;
            return this;
        }
Ejemplo n.º 12
0
 public override void Setup()
 {
     base.Setup();
     underTest = new AutoCommandDescriptorRepository(Array(typeof(TestRunnable)));
 }
Ejemplo n.º 13
0
 public DescriptorService(IUnitOfWork unitOfWork, IDescriptorRepository descriptorRepository)
     : base(unitOfWork, descriptorRepository)
 {
     _unitOfWork           = unitOfWork;
     _descriptorRepository = descriptorRepository;
 }