Example #1
0
        /// <summary>
        /// Sets the extension factory that is used to instantiate extensions.
        /// </summary>
        /// <remarks>
        /// This purpose of this method is to facilitate unit testing by allowing the creation of extensions
        /// to be controlled by the testing code.
        /// </remarks>
        /// <param name="factory"></param>
        public static void SetExtensionFactory(IExtensionFactory factory)
        {
            lock (_syncRoot)
            {
                //I'm sure there are other places where this might be a problem, but if
                //you use an extension factory that creates service provider extensions,
                //you can get UnknownServiceException problems in unit tests unless
                //these 2 variables are repopulated.
                _serviceProviders       = null;
                _duplexServiceProviders = null;
            }

            ExtensionPoint.SetExtensionFactory(factory);
        }
Example #2
0
 /// <summary>
 /// Sets the extension factory that is used to instantiate extensions.
 /// </summary>
 /// <remarks>
 /// This purpose of this method is to facilitate unit testing by allowing the creation of extensions
 /// to be controlled by the testing code.
 /// </remarks>
 /// <param name="factory"></param>
 public static void SetExtensionFactory(IExtensionFactory factory)
 {
     ExtensionPoint.SetExtensionFactory(factory);
 }