public void FallbackService()
        {
            var concrete  = new List <int>();
            var container = new AssignableFallbackContainer();

            container.AddService(typeof(IList <int>), concrete);
            Assert.Equal(concrete, container.GetService(typeof(IEnumerable <int>)));
        }
        public void RegisterServices()
        {
            var abstractType = typeof(IList <int>);
            var concrete     = new List <int>();
            var container    = new AssignableFallbackContainer();

            container.AddService <IList <int> >(concrete);
            Assert.Equal(concrete, container.GetService(abstractType));
        }
        public void InjectDependencies()
        {
            var container = new AssignableFallbackContainer();
            var service   = new List <int>()
            {
                1, 2, 3
            };

            container.AddService <IList <int> >(service);
            var dependent = new MockedConcreteDependency();

            container.SolveDependencies(dependent);
            Assert.Equal(service, dependent.Dependency);
        }