public void add_singleton_service() { FrameworkServiceContainer c = new FrameworkServiceContainer(); ServiceA a = new ServiceA(); c.AddService(typeof(ServiceA), a); Assert.That(c.GetService<ServiceA>(), Is.SameAs(a)); }
public void obtains_service_container_trivially() { FrameworkServiceContainer c = new FrameworkServiceContainer(); Assert.That(c.GetService(typeof(IServiceContainer)), Is.SameAs(c)); Assert.That(c.GetService(typeof(IServiceProvider)), Is.SameAs(c)); Assert.That(c.GetService(typeof(IServiceProviderExtension)), Is.SameAs(c)); }