public void TestDefaultLinkToManagerInstance()
        {
            Mock<IRegistrationMap> mockRegistrationMap = new Mock<IRegistrationMap>();
              Mock<PickRegistrationStrategy> mockRegistrationChain = new Mock<PickRegistrationStrategy>();
              Mock<IResolverMap> mockResolverMap = new Mock<IResolverMap>();
              Mock<FindResolverStrategy> mockResolverChain = new Mock<FindResolverStrategy>();
              Mock<ILifetimeManagerMap> mockManagerMap = new Mock<ILifetimeManagerMap>();
              Mock<FindLifetimeManagerStrategy> mockManagerChain = new Mock<FindLifetimeManagerStrategy>();

              IocContainer testContainer = new IocContainer(mockRegistrationMap.Object,
                                                    mockRegistrationChain.Object,
                                                    mockResolverMap.Object,
                                                    mockResolverChain.Object,
                                                    mockManagerMap.Object,
                                                    mockManagerChain.Object);

              Type managedType = typeof(object);
              Mock<ILifetimeManager> managerMock = new Mock<ILifetimeManager>();
              testContainer.LinkToLifetime(managedType, managerMock.Object);
              mockManagerMap.Verify(map => map.AddOrUpdate(managedType, String.Empty, managerMock.Object));
        }
        public void TestNamedLinkToManagerType()
        {
            Mock<IRegistrationMap> mockRegistrationMap = new Mock<IRegistrationMap>();
              Mock<PickRegistrationStrategy> mockRegistrationChain = new Mock<PickRegistrationStrategy>();
              Mock<IResolverMap> mockResolverMap = new Mock<IResolverMap>();
              Mock<FindResolverStrategy> mockResolverChain = new Mock<FindResolverStrategy>();
              Mock<ILifetimeManagerMap> mockManagerMap = new Mock<ILifetimeManagerMap>();
              Mock<FindLifetimeManagerStrategy> mockManagerChain = new Mock<FindLifetimeManagerStrategy>();

              IocContainer testContainer = new IocContainer(mockRegistrationMap.Object,
                                                    mockRegistrationChain.Object,
                                                    mockResolverMap.Object,
                                                    mockResolverChain.Object,
                                                    mockManagerMap.Object,
                                                    mockManagerChain.Object);

              Type managedType = typeof(object);
              Type managerType = typeof(ExternallyControlledLifetimeManager);
              string identifier = "identifier";
              testContainer.LinkToLifetime(managedType, managerType, identifier);
              mockManagerMap.Verify(map => map.AddOrUpdate(managedType, identifier, managerType));
        }
        public void TestDefaultGenericLinkToManagerTypeGenerically()
        {
            Mock<IRegistrationMap> mockRegistrationMap = new Mock<IRegistrationMap>();
              Mock<PickRegistrationStrategy> mockRegistrationChain = new Mock<PickRegistrationStrategy>();
              Mock<IResolverMap> mockResolverMap = new Mock<IResolverMap>();
              Mock<FindResolverStrategy> mockResolverChain = new Mock<FindResolverStrategy>();
              Mock<ILifetimeManagerMap> mockManagerMap = new Mock<ILifetimeManagerMap>();
              Mock<FindLifetimeManagerStrategy> mockManagerChain = new Mock<FindLifetimeManagerStrategy>();

              IocContainer testContainer = new IocContainer(mockRegistrationMap.Object,
                                                    mockRegistrationChain.Object,
                                                    mockResolverMap.Object,
                                                    mockResolverChain.Object,
                                                    mockManagerMap.Object,
                                                    mockManagerChain.Object);

              Type managedType = typeof(object);
              Type managerType = typeof(ExternallyControlledLifetimeManager);
              testContainer.LinkToLifetime<object, ExternallyControlledLifetimeManager>();
              mockManagerMap.Verify(map => map.AddOrUpdate(managedType, String.Empty, managerType));
        }