상속: IFacility
예제 #1
0
		public void OnCreationCallback()
		{
			StartableFacility facility = null;

			kernel.AddFacility<StartableFacility>(f => facility = f);

			Assert.IsNotNull(facility);
		}
예제 #2
0
파일: IoC-334.cs 프로젝트: RookieX/Windsor
		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);
			}
		}
예제 #3
0
		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);
		}