示例#1
0
        public void AutofacContainerRegistryShouldReturnFalseForIsRegisteredDuringRegistration()
        {
            var registry = new AutofacContainerRegistry(new ContainerBuilder());

            registry.Register <IService, Service>();
            registry.IsRegistered <IService>().Should().BeFalse();
        }
示例#2
0
        public void AutofacContainerRegistryShouldReturnTrueForIsRegisteredOnExistingRegistrations()
        {
            var builder = new ContainerBuilder();

            builder.RegisterType <Service>().As <IService>();
            var container = new MutableContainer(builder);

            var registry = new AutofacContainerRegistry(new ContainerBuilder(), container);

            registry.IsRegistered <IService>().Should().BeTrue();
        }