Esempio n. 1
0
        public void TestNewCompositeBootstrapper()
        {
            CompositeBootstrapper compositeBootstrapper = BootstrapperFactory.NewCompositeBootstrapper(LoggerSetter, Bootstrappers);

            Assert.IsNotNull(compositeBootstrapper);
            Assert.IsInstanceOf(typeof(Bootstrapper), compositeBootstrapper);
            Assert.IsInstanceOf(typeof(CompositeBootstrapperImpl), compositeBootstrapper);
            CompositeBootstrapperImpl compositeBootstrapperImpl = (CompositeBootstrapperImpl)compositeBootstrapper;

            Assert.AreEqual(Bootstrappers, compositeBootstrapperImpl.SubBootstrappers);
            Assert.IsTrue(LoggerSetterImpl.LoggerRecipients.Contains(compositeBootstrapper));
        }
        public void TestBootstrap()
        {
            CompositeBootstrapper bootstrapper = BootstrapperFactory.NewCompositeBootstrapper(LoggerSetter, MockBootstrapperList);

            foreach (Bootstrapper subBootstrapper in MockBootstrapperList)
            {
                Assert.IsFalse(subBootstrapper.IsDone);
            }
            Assert.IsFalse(bootstrapper.IsDone);
            bootstrapper.Bootstrap();
            foreach (Bootstrapper subBootstrapper in MockBootstrapperList)
            {
                Assert.IsTrue(subBootstrapper.IsDone);
            }
            Assert.IsTrue(bootstrapper.IsDone);
        }