Esempio n. 1
0
        private void RunTest(Action <WindsorContainer, ILogger <object>, DeclaringNonGenericTypeMustBeRegisteredInContainerAfterLoggerConfigured> testAction)
        {
            WindsorContainer container = new WindsorContainer();
            var logger = LoggerFactory.Create <object>().BindToWindsor(container.Kernel);
            DeclaringNonGenericTypeMustBeRegisteredInContainerAfterLoggerConfigured requirement = new DeclaringNonGenericTypeMustBeRegisteredInContainerAfterLoggerConfigured(container.Kernel);

            testAction(container, logger, requirement);
        }
Esempio n. 2
0
 public void CheckingRequirementWhenLoggerNotBoundToWindsorShouldThrowUnableToCheckRequirementException()
 {
     Assert.Catch <UnableToCheckRequirementException>(() =>
     {
         WindsorContainer container = new WindsorContainer();
         container.Register(Component.For <TestClass>().ImplementedBy <TestClass>());
         DeclaringNonGenericTypeMustBeRegisteredInContainerAfterLoggerConfigured requirement = new DeclaringNonGenericTypeMustBeRegisteredInContainerAfterLoggerConfigured(container.Kernel);
         var result = requirement.SatisfiedBy(Method <TestClass>(m => m.TestMethod()));
     });
 }