public void Qualifier() { ServicePostRegistry.AddSingleton(typeof(IService), typeof(Service), "testqua"); Assert.True(Sp.IsRegistered <IService>("testqua")); Assert.False(Sp.IsRegistered <IService>("notexist")); }
public void Unregister() { ServicePostRegistry.AddSingleton(typeof(IService), typeof(Service), null); var service = Sp.GetRequiredService <IService>(); Assert.True(Sp.IsRegistered <IService>()); Assert.False(service.Disposed); ServicePostRegistry.Unregister(typeof(IService), null); Assert.False(Sp.IsRegistered <IService>()); Assert.True(service.Disposed); }