Beispiel #1
0
        public void GetSingletonInstanceOrAdd()
        {
            var services = new ServiceCollection();

            services.GetSingletonInstanceOrAdd <IService1>(new Service1()).ShouldBeOfType <Service1>().ShouldNotBeNull();
            services.GetSingletonInstanceOrAdd <IService1>(new Service2()).ShouldBeOfType <Service1>().ShouldNotBeNull();
        }