Ejemplo n.º 1
0
        public void WhenRegistrationsAreMadeTheyDoNotAffectTheReadRegistry()
        {
            var read = new ComponentRegistry();
            var cow = new CopyOnWriteRegistry(read, () => new ComponentRegistry());
            var registration = RegistrationBuilder.ForType<object>().CreateRegistration();
            cow.Register(registration);

            var objectService = new TypedService(typeof (object));
            Assert.True(cow.IsRegistered(objectService));
            Assert.False(read.IsRegistered(objectService));
        }
Ejemplo n.º 2
0
 public void LoadsRegistrations()
 {
     var cr = new ComponentRegistry();
     new ObjectModule().Configure(cr);
     Assert.True(cr.IsRegistered(new TypedService(typeof(object))));
 }
Ejemplo n.º 3
0
 public void WhenARegistrationSourceQueriesForTheSameService_ItIsNotRecursivelyQueried()
 {
     var registry = new ComponentRegistry();
     registry.AddRegistrationSource(new RecursiveRegistrationSource());
     Assert.False(registry.IsRegistered(new UniqueService()));
 }