예제 #1
0
        public void TestAttachedComponentNames_NotEmpty()
        {
            var attachedComponentNames = new List <string>
            {
                "module1",
                "module2",
            };
            var provider = new DependencyInjectionComponentStateProvider(attachedComponentNames);

            Assert.NotEmpty(provider.AttachedComponentNames);
        }
예제 #2
0
        public void TestAttachedComponentNames_DoesNotContainsModule()
        {
            var attachedComponentNames = new List <string>
            {
                "module1",
                "module2",
            };
            var provider = new DependencyInjectionComponentStateProvider(attachedComponentNames);

            Assert.DoesNotContain(provider.AttachedComponentNames, f => f == "module3");
        }
예제 #3
0
        public IReadOnlyList <ServiceRegistration> GetServiceRegistrations()
        {
            // Create component state provider instance
            var attachedComponentNames = _components
                                         .Select(m => m.Name)
                                         .ToList();
            var componentStateProvider = new DependencyInjectionComponentStateProvider(attachedComponentNames);

            _providers[Providers.DependencyInjectionComponentStateProvider].ImplementationInstance = componentStateProvider;

            return(new List <ServiceRegistration>()
                   .Union(_providers.Values)
                   .ToList());
        }