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));
        }
示例#2
0
 public void LoadsRegistrations()
 {
     var cr = new ComponentRegistry();
     new ObjectModule().Configure(cr);
     Assert.True(cr.IsRegistered(new TypedService(typeof(object))));
 }
 public void WhenARegistrationSourceQueriesForTheSameService_ItIsNotRecursivelyQueried()
 {
     var registry = new ComponentRegistry();
     registry.AddRegistrationSource(new RecursiveRegistrationSource());
     Assert.False(registry.IsRegistered(new UniqueService()));
 }