private MockStrategyChain GetStrategies() { MockStrategyChain chain = new MockStrategyChain(); chain.Add(new LifetimeStrategy()); chain.Add(new SleepingStrategy()); chain.Add(new NewObjectStrategy()); return(chain); }
private BuilderContext GetContext(IUnityContainer container, NamedTypeBuildKey buildKey) { var strategies = new MockStrategyChain(); strategies.Add(new ReturnContainerStrategy(container)); PolicyList persistentPolicies = new PolicyList(); PolicyList transientPolicies = new PolicyList(persistentPolicies); return(new BuilderContext(new UnityContainer(), strategies, null, persistentPolicies, transientPolicies, buildKey, null)); }
private void FillStrategyChain(MockStrategyChain chain, int index) { lock (_lockObject) { if (_innerChain != null) { _innerChain.FillStrategyChain(chain, index); } chain.AddRange(_stages[index]); } }
/// <summary> /// Makes a strategy chain based on this instance. /// </summary> /// <returns>A new <see cref="MockStrategyChain"/>.</returns> public IStrategyChain MakeStrategyChain() { lock (_lockObject) { var result = new MockStrategyChain(); for (int index = 0; index < _stages.Length; ++index) { FillStrategyChain(result, index); } return(result); } }
public BuilderOnThread(MockStrategyChain strategies, IPolicyList policies) { this.strategies = strategies; this.policies = policies; }