Skip to content

Commit df43d9b

Browse files
authored
Merge pull request #1 from ENikS/master
Updating references to Abstractions.3.0.0 and Container.5.5.0
2 parents ace2ace + 9a3cc06 commit df43d9b

File tree

2 files changed

+15
-23
lines changed

2 files changed

+15
-23
lines changed

package.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
</PropertyGroup>
77

88
<PropertyGroup>
9-
<UnityAbstractionsVersion>2.4.*</UnityAbstractionsVersion>
10-
<UnityContainerVersion>5.4.*</UnityContainerVersion>
9+
<UnityAbstractionsVersion>3.*</UnityAbstractionsVersion>
10+
<UnityContainerVersion>5.*</UnityContainerVersion>
1111
<UnityInterceptionVersion>5.*</UnityInterceptionVersion>
1212
<UnityConfigurationVersion>5.*</UnityConfigurationVersion>
1313
</PropertyGroup>

tests/TestSupport/MockBuilderContext.cs

Lines changed: 13 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)