Example #1
0
        public void ThrowsBootException_WhenSanityCheckFails()
        {
            var kernel        = new Kernel();
            var configuration = new BootConfiguration(AssemblyCollectionMockBuilder.GetWithFailingSanityCheck());

            configuration.Seal();
            var exception = Assert.Throws <BootException>(() => kernel.Boot(configuration));

            Assert.Equal(CoreErrorCodes.InsaneKernel, exception.ErrorCode);
        }
Example #2
0
        public void RegistersCommandsFromBootConfiguration()
        {
            var kernel        = new Kernel();
            var configuration = new BootConfiguration(AssemblyCollectionMockBuilder.GetWithEasyCommand());

            configuration.WithOutput(this.output.WriteLine);
            configuration.Seal();

            kernel.Boot(configuration);

            var registry = kernel.ServiceLocator.GetService <ICommandRegistry>();

            Assert.True(registry.IsRegistered("Test"));
        }