Hi,
Best would be if yours code and unit tests are not aware of inversion
of control framework (like Windsor). Ideally Windsor is used only to
integrate your components in finished application.
However if you use Windsor as service provider you should be aware
that Windsor is mainly configuration layer. Actual component container
is MicroKernel. Your code should look something like this:
MockRepository mocks = new MockRepository();
IWindsorContainer _container = new WindsorContainer();
IDependency dependency = mocks.CreateMock<IDependency>();
_container.Kernel.AddComponentInstance("test-dependency",
typeof(IDependency), dependency);
...
IDependency _someDependency = _container.Resolve<IDependency>();
_someDependency.DoSomething();
This way you can initialize dependency container any way you like for
each test individually if necessary.