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>());
        }
        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();
        }
Exemple #3
0
 public ItIs()
 {
     _bootstrapper = new Bootstrapper();
     _configureDependencies = new ConfigureDependencies();
     _conventions = new List<IRegistrationConvention>();
 }