public void OnCreationCallback() { StartableFacility facility = null; kernel.AddFacility<StartableFacility>(f => facility = f); Assert.IsNotNull(facility); }
public void FacilityConfig_is_not_null() { using (var c = new DefaultKernel()) { const string facilityKey = "hiper"; var config = new MutableConfiguration("facility"); c.ConfigurationStore.AddFacilityConfiguration(facilityKey, config); var facility = new HiperFacility(); c.AddFacility(facilityKey, facility); Assert.IsTrue(facility.Initialized); } }
public void Init() { _kernel = new DefaultKernel(); IConfiguration confignode = new MutableConfiguration("facility"); IConfiguration facilityConf = confignode.Children.Add(new MutableConfiguration(FacilityKey)); _kernel.ConfigurationStore.AddFacilityConfiguration(FacilityKey, confignode); _facility = new HiperFacility(); Assert.IsFalse(_facility.Initialized); _kernel.AddFacility(FacilityKey, _facility); }