Exemplo n.º 1
0
        public static TypeProviderConfig CreateConfig(Assembly runtimeAssembly, IEnumerable <Assembly> additionalAssemblies)
        {
            var referencedAssemblies = runtimeAssembly.GetReferencedAssemblies();
            var requiredAssemblies   = new[] {
                typeof(object).Assembly,
                Assembly.Load("FSharp.Core"),
                Assembly.Load("FSharp.Data.DesignTime")
            };

            var assemblies = new[] { runtimeAssembly }
            .Concat(requiredAssemblies)
            .Concat(additionalAssemblies)
            .Select(asm => new ImportedBinaryMock(asm.Location));
            var @base     = new TcImportsMock(new ImportedBinaryMock[0], Microsoft.FSharp.Core.FSharpOption <TcImportsMock> .None);
            var tcImports = new TcImportsMock(assemblies, Microsoft.FSharp.Core.FSharpOption <TcImportsMock> .Some(@base));
            var systemRuntimeContainsType = new SystemRuntimeContainsTypeMock(tcImports);

            return(new TypeProviderConfig(systemRuntimeContainsType)
            {
                RuntimeAssembly = runtimeAssembly.FullName
            });
        }
Exemplo n.º 2
0
 public SystemRuntimeContainsTypeMock(TcImportsMock tcImports)
 {
     this.tcImports = tcImports;
 }