public void TestCreateLogger()
        {
            IKernel kernel = new BaseKernel();
            LoggerManager manager = new LoggerManager();

            kernel.AddSubsystem( KernelConstants.LOGGER, manager );

            ILogger logger = manager.CreateLogger( "name", "impl", null );
            AssertNotNull( logger );
        }
        public void TestUsage()
        {
            IKernel kernel = new BaseKernel();
            LoggerManager manager = new LoggerManager();

            kernel.AddSubsystem( KernelConstants.LOGGER, manager );

            IKernelSubsystem subsystem = kernel.GetSubsystem( KernelConstants.LOGGER );
            AssertNotNull( subsystem );
            AssertEquals( subsystem, manager );
        }
        public void WrappingComponent()
        {
            IKernel container = new BaseKernel();

            container.ComponentWrap += new WrapDelegate(ComponentWrap);
            container.ComponentUnWrap += new WrapDelegate(ComponentUnWrap);

            container.AddComponent( "a", typeof(IMailService), typeof(SimpleMailService) );

            IHandler handler = container[ "a" ];

            IMailService service = handler.Resolve() as IMailService;

            service.Send("hammett at apache dot org", "johndoe at yahoo dot org", "Aloha!", "What's up?");
            Assert( m_interceptor.InterceptorInvoked );

            handler.Release( service );
        }
Пример #4
0
 public Vertex(BaseKernel k)
 {
     K = k;
 }