void RegisterFileSearchServices(TinyIoCContainer container)
 {
     container.Register(
         typeof(IFileSearch),
         (c, p) => CreateFileSearch(c),
         HostBase.FileSearchComponentName(typeof(T))
         );
     container.RegisterMultiple(
         typeof(IFileSearchModifier <T>),
         getImplementationTypes(typeof(IFileSearchModifier <T>))
         ).AsMultiInstance();
 }
Example #2
0
 void RegisterFileSearches(TinyIoCContainer container)
 {
     foreach (var fileSearch in fileSearches)
     {
         var bundleType = fileSearch.Key;
         container.Register(
             typeof(IFileSearch),
             fileSearch.Value,
             HostBase.FileSearchComponentName(bundleType)
             );
     }
 }
Example #3
0
        public void SetDefaultFileSearchCausesConfigureToRegisterAFileSearchForTheBundleType()
        {
            var customFileSearch = new FileSearch();

            config.SetDefaultFileSearch <ScriptBundle>(customFileSearch);
            var container = new TinyIoCContainer();

            config.Configure(container);

            var actualFileSearch = container.Resolve <IFileSearch>(HostBase.FileSearchComponentName(typeof(ScriptBundle)));

            actualFileSearch.ShouldBeSameAs(customFileSearch);
        }