Пример #1
0
        public void should_execute_initialization_task()
        {
            var bootstrapper = new Bootstrapper();
            var task = Substitute.For<IInitializationTask>();

            bootstrapper.Tasks.Add(task);
            bootstrapper.Initialize();

            task.Received().Execute(Arg.Any<InitializationTaskContext>());
        }
Пример #2
0
        public void should_execute_discovered_startup_task()
        {
            var bootstrapper = new Bootstrapper();
            var startupTask = Substitute.For<IStartupTask>();

            var register = new ActionTask(
                context => context.Builder.RegisterInstance(startupTask)
                                  .AsImplementedInterfaces());

            bootstrapper.Tasks.Add(register);
            bootstrapper.Initialize();
            bootstrapper.Start();

            startupTask.Received().Execute();
        }
Пример #3
0
 public ItIs()
 {
     _bootstrapper = new Bootstrapper();
     _configureDependencies = new ConfigureDependencies();
     _conventions = new List<IRegistrationConvention>();
 }