1 // Copyright 2004-2007 Castle Project - http://www.castleproject.org/
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
7 // http://www.apache.org/licenses/LICENSE-2.0
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
15 namespace Castle
.Windsor
.Tests
18 using NUnit
.Framework
;
57 private IWM _vm
= null;
58 private ISP _sp
= null;
65 public DN(IWM vm
, ISP sp
)
94 private ISP _sp
= null;
108 public class SP
: ISP
110 public void Save(IS s
)
116 public class ContainerProblem2
119 public void CausesStackOverflow()
121 IWindsorContainer container
= new WindsorContainer();
123 container
.AddComponent("BS", typeof(IS
), typeof(BS
));
124 container
.AddComponent("C", typeof(IC
), typeof(C
));
125 container
.AddComponent("WM", typeof(IWM
), typeof(WM
));
126 container
.AddComponent("SP", typeof(ISP
), typeof(SP
));
128 // ComponentModel model = new ComponentModel("R", typeof(R), typeof(R));
129 // model.LifestyleType = LifestyleType.Custom;
130 // model.CustomLifestyle = typeof(PerThreadLifestyleManager);
132 // container.Kernel.AddCustomComponent(model);
133 // container.Kernel.AddComponent("R", typeof(R), LifestyleType.Thread);
134 container
.Kernel
.AddComponent("R", typeof(R
));
136 IC c
= container
["C"] as IC
;