@@ -89,12 +89,14 @@ public object Existing
8989
9090 public IUnityContainer Container { get ; set ; }
9191
92+ public IBuilderContext ParentContext => throw new NotImplementedException ( ) ;
93+
9294 public void AddResolverOverrides ( IEnumerable < ResolverOverride > newOverrides )
9395 {
9496 resolverOverrides . AddRange ( newOverrides ) ;
9597 }
9698
97- public IDependencyResolverPolicy GetOverriddenResolver ( Type dependencyType )
99+ public IResolverPolicy GetOverriddenResolver ( Type dependencyType )
98100 {
99101 return resolverOverrides . GetResolver ( this , dependencyType ) ;
100102 }
@@ -127,17 +129,15 @@ public object NewBuildUp(INamedType newBuildKey)
127129 return clone . Strategies . ExecuteBuildUp ( clone ) ;
128130 }
129131
130- /// <summary>
131- /// A convenience method to do a new buildup operation on an existing context. This
132- /// overload allows you to specify extra policies which will be in effect for the duration
133- /// of the build.
134- /// </summary>
135- /// <param name="newBuildKey">Key defining what to build up.</param>
136- /// <param name="childCustomizationBlock">A delegate that takes a <see cref="IBuilderContext"/>. This
137- /// is invoked with the new child context before the build up process starts. This gives callers
138- /// the opportunity to customize the context for the build process.</param>
139- /// <returns>Created object.</returns>
140- public object NewBuildUp ( INamedType newBuildKey , Action < IBuilderContext > childCustomizationBlock )
132+ public object ExecuteBuildUp ( NamedTypeBuildKey buildKey , object existing )
133+ {
134+ this . BuildKey = buildKey ;
135+ this . Existing = existing ;
136+
137+ return Strategies . ExecuteBuildUp ( this ) ;
138+ }
139+
140+ public object NewBuildUp ( Type type , string name , Action < IBuilderContext > childCustomizationBlock = null )
141141 {
142142 var newContext = new MockBuilderContext
143143 {
@@ -146,7 +146,7 @@ public object NewBuildUp(INamedType newBuildKey, Action<IBuilderContext> childCu
146146 policies = new PolicyList ( persistentPolicies ) ,
147147 lifetime = lifetime ,
148148 originalBuildKey = buildKey ,
149- buildKey = newBuildKey ,
149+ buildKey = new NamedTypeBuildKey ( type , name ) ,
150150 existing = null
151151 } ;
152152 newContext . resolverOverrides . Add ( resolverOverrides ) ;
@@ -155,13 +155,5 @@ public object NewBuildUp(INamedType newBuildKey, Action<IBuilderContext> childCu
155155
156156 return strategies . ExecuteBuildUp ( newContext ) ;
157157 }
158-
159- public object ExecuteBuildUp ( NamedTypeBuildKey buildKey , object existing )
160- {
161- this . BuildKey = buildKey ;
162- this . Existing = existing ;
163-
164- return Strategies . ExecuteBuildUp ( this ) ;
165- }
166158 }
167159}
0 commit comments