public void GetAssignableHandlers() { IKernel kernel = new DefaultKernel(); kernel.AddSubSystem(SubSystemConstants.NamingKey, new NamingPartsSubSystem()); kernel.AddComponent("common:key1=true", typeof(ICommon), typeof(CommonImpl1)); kernel.AddComponent("common:secure=true", typeof(ICommon), typeof(CommonImpl2)); IHandler[] handlers = kernel.GetAssignableHandlers(typeof(ICommon)); Assert.IsNotNull(handlers); Assert.AreEqual(2, handlers.Length); }
public void GetAssignableHandlers() { IKernel kernel = new DefaultKernel(); kernel.AddSubSystem(SubSystemConstants.NamingKey, new NamingPartsSubSystem()); kernel.AddComponent("common:key1=true", typeof(ICommon), typeof(CommonImpl1)); kernel.AddComponent("common:secure=true", typeof(ICommon), typeof(CommonImpl2)); IHandler[] handlers = kernel.GetAssignableHandlers(typeof(ICommon)); Assert.IsNotNull(handlers); Assert.AreEqual(2, handlers.Length); }