public void TestGetObjectsInheritingFromSuperClassFromContainer() { var container = new DependencyInjector(new ServiceConfiguration(), new MoreConfig()); container.ExpandConfiguration(new ComplexConfig()); container.Reconfigure(); Assert.IsTrue(container.ContainsObject<ISomeDomainCmdService>()); Assert.IsTrue(container.ContainsObject<ICommandManager>()); Assert.IsTrue(container.ContainsObject("SomeDomainCmdServiceB")); Assert.IsTrue(container.ContainsObject<IAggregate>()); List<ISomeDomainCmdService> someDomainCmdServices = container.GetAllObjectsInheriting<ISomeDomainCmdService>(); Assert.AreEqual(2, someDomainCmdServices.Count); List<SomeDomainCmdServiceC> someDomainCmdServicesC = container.GetAllObjectsInheriting<SomeDomainCmdServiceC>(); Assert.AreEqual(0, someDomainCmdServicesC.Count); }
public void TestGetObjectsInheritingFromPrototypeSuperClassFromContainer() { var container = new DependencyInjector(new ServiceConfiguration(), new MoreConfig()); container.ExpandConfiguration(new ComplexConfig()); container.Reconfigure(); List<Prototype> prototypes = container.GetAllObjectsInheriting<Prototype>(); Assert.AreEqual(1, prototypes.Count); }