Ejemplo n.º 1
0
        public void TestAttachedComponentNames_NotEmpty()
        {
            var attachedComponentNames = new List <string>
            {
                "module1",
                "module2",
            };
            var provider = new DependencyInjectionComponentStateProvider(attachedComponentNames);

            Assert.NotEmpty(provider.AttachedComponentNames);
        }
Ejemplo n.º 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");
        }
Ejemplo n.º 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());
        }