示例#1
0
        private Assembly MockCorePlugin_MapToAssemblyCallback(MockCorePlugin mockPlugin)
        {
            // We'll just map the newly instantiated core plugin to any of the assemblies
            // we're mock-providing, except the ones that are already mapped
            Assembly assembly;

            if (!this.pluginMap.TryGetValue(mockPlugin, out assembly))
            {
                assembly = this.assemblyMap
                           .Where(pair => !this.pluginMap.ContainsValue(pair.Value))
                           .Where(pair => pair.Key.EndsWith(".core.dll", StringComparison.InvariantCultureIgnoreCase))
                           .Select(pair => pair.Value)
                           .FirstOrDefault();
                this.pluginMap.Add(mockPlugin, assembly);
            }
            return(assembly);
        }
示例#2
0
 private Assembly MockCorePlugin_MapToAssemblyCallback(MockCorePlugin mockPlugin)
 {
     // We'll just map the newly instantiated core plugin to any of the assemblies
     // we're mock-providing, except the ones that are already mapped
     Assembly assembly;
     if (!this.pluginMap.TryGetValue(mockPlugin, out assembly))
     {
         assembly = this.assemblyMap
             .Where(pair => !this.pluginMap.ContainsValue(pair.Value))
             .Where(pair => pair.Key.EndsWith(".core.dll", StringComparison.InvariantCultureIgnoreCase))
             .Select(pair => pair.Value)
             .FirstOrDefault();
         this.pluginMap.Add(mockPlugin, assembly);
     }
     return assembly;
 }