public void GetServices_UnknownService_ReturnsEmptyEnumerable() { var container = CreateContainer(); container.Register<IBar, Bar>(); IDependencyResolver resolver = new LightInjectMvcDependencyResolver(container); var instances = resolver.GetServices<IFoo>(); Assert.AreEqual(0, instances.Count()); }
public void GetServices_MultipleServices_ReturnsAllInstances() { var container = CreateContainer(); container.Register<IFoo, Foo>(); container.Register<IFoo, AnotherFoo>("AnotherFoo"); IDependencyResolver resolver = new LightInjectMvcDependencyResolver(container); var instances = resolver.GetServices<IFoo>(); Assert.AreEqual(2, instances.Count()); }