protected override void EstablishContext() { container = new WindsorContainer(); // Add the facility, capturing a reference so we can "Finalize" it ChainOfResponsibilityFacility facility = null; container.AddFacility <ChainOfResponsibilityFacility>(f => facility = f); // Perform all registrations of links in the chain using the standard approach container.Register( Classes.FromThisAssembly() .BasedOn <ISomethingProvider>() .WithService .FromInterface()); // Finalize all Chain of Responsibility chains (registering the proxy last, required prior to Castle 3.x) facility.FinalizeChains(); anotherProvider = mocks.Stub <IAnotherProvider>(); container.Register( Component.For <IAnotherProvider>() .Instance(anotherProvider)); }
protected override void Arrange() { // Set up mocked dependencies and supplied values _container = new WindsorContainer(); // Add the facility, capturing a reference so we can "Finalize" it ChainOfResponsibilityFacility facility = null; _container.AddFacility <ChainOfResponsibilityFacility>(f => facility = f); _container.Register( Classes.FromThisAssembly() .BasedOn <ISomethingWithMethodOverLoads>() .WithService .FromInterface()); // Finalize all Chain of Responsibility chains (registering the proxy last, required prior to Castle 3.x) facility.FinalizeChains(); }
protected override void EstablishContext() { // Set up mocked dependences and supplied values container = new WindsorContainer(); // Add the facility, capturing a reference so we can "Finalize" it ChainOfResponsibilityFacility facility = null; container.AddFacility <ChainOfResponsibilityFacility>(f => facility = f); // Perform a legacy chain of responsibility registration var registrar = new ChainOfResponsibilityRegistrar(container); registrar.RegisterChainOf <ISomethingElseProvider, NullSomethingElseProvider>( new[] { typeof(FirstSomethingElseProvider), typeof(SecondSomethingElseProvider) }); // Finalize all Chain of Responsibility chains (registering the proxy last, required prior to Castle 3.x) facility.FinalizeChains(); }