예제 #1
0
        /// <summary>
        /// Gets types for given IRenderings
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <returns></returns>
        public IEnumerable <Type> GetTypesFor <T>() where T : IRendering
        {
            EnsureTypes();
            var types = _TypeFinder.GetTypesFor(typeof(T));

            if (types.Any() == false)
            {
                throw new Exception($"Unable to find types for: {typeof(T).FullName}, please review IRenderingTypeFinderSettings implementation: {_RenderingTypeFinderSettings.GetType().FullName}!");
            }

            return(types);
        }
예제 #2
0
        public void ShouldScanServiceAttributes()
        {
            var types = _AssemblyScanner.GetTypesFor(typeof(RegistrationAttribute));

            Assert.IsTrue(types?.Count() > 0);
        }