public void RegisterTypes_SingletonConfiguration_MergedIntoOutput() { TestableUnityConfigProvider.AddSingletons(typeof(String)); var types = new[] { typeof(TestableUnityConfigProvider) }; // Act controller.RegisterTypes(MappingBehaviors.None, types); // Assert mappingFactory.Verify(mf => mf.CreateMappings(MappingBehaviors.None, It.Is <AutomapperConfig>(ac => ac.IsMarkedWithCustomLifetimeManager(typeof(String)).Item1), types)); }
public void RegisterTypes_PolicyInjectionConfiguration_MergedIntoOutput() { TestableUnityConfigProvider.AddPolicyInjection(typeof(String)); var types = new[] { typeof(TestableUnityConfigProvider) }; // Act controller.RegisterTypes(MappingBehaviors.None, types); // Assert mappingFactory.Verify(mf => mf.CreateMappings(MappingBehaviors.None, It.Is <AutomapperConfig>(ac => ac.IsMarkedForPolicyInjection(typeof(String))), types)); }
public void Setup() { target = new Mock <IUnityContainer>(); mappingFactory = new Mock <ITypeMappingFactory>(); internalContainer = new Mock <IUnityContainer>(); mappingHandler = new Mock <ITypeMappingHandler>(); internalContainer.Setup(c => c.Resolve(typeof(ITypeMappingHandler), null, It.IsAny <ResolverOverride[]>())).Returns(mappingHandler.Object); controller = new MappingController(target.Object, mappingFactory.Object, internalContainer.Object); TestableUnityConfigProvider.Reset(); }