Skip to content

Commit cc05196

Browse files
committed
Better method name
1 parent 18add29 commit cc05196

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Moq.AutoMock/AutoMocker.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1016,15 +1016,15 @@ bool TryCreateArguments(ConstructorInfo constructor, ObjectGraphContext context,
10161016
return false;
10171017
}
10181018

1019-
TryCache(parameters[i].ParameterType, service);
1019+
EnsureCached(parameters[i].ParameterType, service);
10201020
arguments[i] = service;
10211021
}
10221022
return true;
10231023
}
10241024

10251025
}
10261026

1027-
private void TryCache(Type type, IInstance instance)
1027+
private void EnsureCached(Type type, IInstance instance)
10281028
{
10291029
WithTypeMap(typeMap =>
10301030
{
@@ -1040,7 +1040,7 @@ private Mock GetOrMakeMockFor(Type type)
10401040
if (TryResolve(type, new ObjectGraphContext(false), out IInstance? instance) &&
10411041
instance is MockInstance mockInstance)
10421042
{
1043-
TryCache(type, mockInstance);
1043+
EnsureCached(type, mockInstance);
10441044
return mockInstance.Mock;
10451045
}
10461046
throw new ArgumentException($"{type} does not resolve to a Mock");

0 commit comments

Comments
 (0)