Exemple #1
0
        public static void UserRole_DefaultImplementation_ReturnsDefaultImplementation(IContainerAdapter container)
        {
            var mapper = new ContextMapper <Role>(container, new RoleProvider(Role.User));

            mapper.RegisterDefault <IService, DefaultImplementation>();

            var service = container.GetInstance(typeof(IService));

            Assert.IsInstanceOfType(service, typeof(DefaultImplementation));
        }
Exemple #2
0
 public TComponent Get <TComponent>() where TComponent : class
 {
     return((TComponent)_containerAdapter.GetInstance(typeof(TComponent)));
 }
 private static MappedDependencyContextInstanceProvider <TContext> GetMappedDependencyContextInstanceProvider(IContainerAdapter container)
 {
     return((MappedDependencyContextInstanceProvider <TContext>)container.GetInstance(typeof(MappedDependencyContextInstanceProvider <TContext>)));
 }