Skip to content

Commit

Permalink
Better method name
Browse files Browse the repository at this point in the history
  • Loading branch information
adamhewitt627 committed Jan 4, 2023
1 parent 18add29 commit cc05196
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Moq.AutoMock/AutoMocker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1016,15 +1016,15 @@ bool TryCreateArguments(ConstructorInfo constructor, ObjectGraphContext context,
return false;
}

TryCache(parameters[i].ParameterType, service);
EnsureCached(parameters[i].ParameterType, service);
arguments[i] = service;
}
return true;
}

}

private void TryCache(Type type, IInstance instance)
private void EnsureCached(Type type, IInstance instance)
{
WithTypeMap(typeMap =>
{
Expand All @@ -1040,7 +1040,7 @@ private Mock GetOrMakeMockFor(Type type)
if (TryResolve(type, new ObjectGraphContext(false), out IInstance? instance) &&
instance is MockInstance mockInstance)
{
TryCache(type, mockInstance);
EnsureCached(type, mockInstance);
return mockInstance.Mock;
}
throw new ArgumentException($"{type} does not resolve to a Mock");
Expand Down

0 comments on commit cc05196

Please sign in to comment.