public void Setup()
        {
            var aliases = new Dictionary <string, string>
            {
                { "dict", typeof(Dictionary <,>).AssemblyQualifiedName },
                { "ILogger", "Unity.TestSupport.ILogger, Tests.Unity.Configuration" },
                { "MockLogger", "Unity.TestSupport.MockLogger, Tests.Unity.Configuration" }
            };

            var namespaces = new string[0];
            var assemblies = new[] { "System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", "Tests.Unity.Configuration", "an invalid assembly name", "invalid, invalid" };

            typeResolver = new TypeResolverImpl(aliases, namespaces, assemblies);
        }
        private void InitializeTypeResolver(Property property)
        {
            var aliases    = property.ContainingSection.DescendentConfigurationsOfType <AliasElement>();
            var namespaces = property.ContainingSection.DescendentConfigurationsOfType <NamespaceElement>();
            var assemblies = property.ContainingSection.DescendentConfigurationsOfType <AssemblyElement>();

            typeResolver = new TypeResolverImpl(
                aliases.Select(evm => new KeyValuePair <string, string>(
                                   (string)evm.Property("Alias").Value,
                                   (string)evm.Property("TypeName").Value)),
                namespaces.Select(evm => (string)evm.Property("Name").Value),
                assemblies.Select(evm => (string)evm.Property("Name").Value)
                );
        }
示例#3
0
        public void Setup()
        {
            var aliases = new Dictionary <string, string>
            {
                { "dict", typeof(Dictionary <,>).AssemblyQualifiedName },
                { "ILogger", "Microsoft.Practices.Unity.TestSupport.ILogger, Unity.TestSupport" },
                { "MockLogger", "Microsoft.Practices.Unity.TestSupport.MockLogger, Unity.TestSupport" }
            };

            var namespaces = new[] { "System", "System.Collections.Generic", "Microsoft.Practices.Unity.TestSupport" };
            var assemblies = new[] { "LinqBridge" /*"System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"*/, "Unity.TestSupport" };

            typeResolver = new TypeResolverImpl(aliases, namespaces, assemblies);
        }
示例#4
0
 public CecilifierContext(SemanticModel semanticModel)
 {
     SemanticModel       = semanticModel;
     DefinitionVariables = new DefinitionVariableManager();
     TypeResolver        = new TypeResolverImpl(this);
 }