-
Notifications
You must be signed in to change notification settings - Fork 9
Add next code to register mock and objec with one call #7
Open
Description
This speeds up registering custom mock in base class of test (e.g. MyRepository) and then resolving mock in child to tune base behavior:
public static class UnityMoqContainerExtensions
{
public static IUnityContainer RegisterMock<T>(this IUnityContainer self, Mock<T> mock)
where T:class
{
return self.RegisterInstance(mock).RegisterInstance(mock.Object);
}
}
Metadata
Metadata
Assignees
Labels
No labels