Beispiel #1
0
        public virtual IBeanDefinitionCollection UnityAddonEfBeans()
        {
            IBeanDefinitionCollection col = new BeanDefinitionCollection();

            col.AddFromComponentScanner(Assembly.GetExecutingAssembly(), "UnityAddon.Ef");

            return(col);
        }
Beispiel #2
0
        public virtual IBeanDefinitionCollection EnableUnityAddonHangfire()
        {
            IBeanDefinitionCollection col = new BeanDefinitionCollection();

            col.AddFromComponentScanner(Assembly.GetExecutingAssembly(), "UnityAddon.Hangfire");

            return(col);
        }
        public void ScanComponents()
        {
            IBeanDefinitionCollection defCol = new BeanDefinitionCollection();

            defCol.AddFromComponentScanner(GetType().Assembly, GetType().Namespace);

            Assert.NotNull(defCol.Where(def => def.Type == typeof(Service)).Single());
            Assert.NotNull(defCol.Where(def => def.Type == typeof(Config)).Single());
            Assert.Equal(2, defCol.Count());
        }
        public virtual IBeanDefinitionCollection ComponentScan(UnityAddonTest testcase, [Dependency("Namespaces")] string[] namespaces)
        {
            IBeanDefinitionCollection col = new BeanDefinitionCollection();

            var nsmerge = new[] { testcase.GetType().Namespace }.Union(namespaces).ToArray();

            col.AddFromComponentScanner(testcase.GetType().Assembly, nsmerge);

            return(col);
        }
Beispiel #5
0
        public virtual IBeanDefinitionCollection EnableUnityAddonCache()
        {
            IBeanDefinitionCollection col = new BeanDefinitionCollection();

            col.AddFromComponentScanner(Assembly.GetExecutingAssembly(), "UnityAddon.Cache");
            col.AddFromServiceCollection(config =>
            {
                config.AddMemoryCache();
            });

            return(col);
        }