public void path_Package()
 {
     var packageName = "FluentSharp.CoreLib";
     var nuGet = new API_NuGet();
     nuGet.install(packageName);
     nuGet.path_Package(packageName).assert_Not_Null()
                                    .assert_Contains(packageName)
                                    .assert_Folder_Exists();
 }
        public void mapNuGetReferences()
        {
            var targetPackage = "FluentSharp.HtmlAgilityPack";
            var nuGet = new API_NuGet("_temp_Packages_Folder".temp_Dir());

            new API_NuGet().setup().NuGet_Exe.file_CopyToFolder(nuGet.Packages_Folder);         // do this so that the nuget.exe file is not downloaded every time this unit test runs
            nuGet.NuGet_Exe.assert_File_Exists();
            nuGet.path_Package(targetPackage).assert_Null();

            nuGet.path_Package(targetPackage);
            var compilerOptions = new CSharp_FastCompiler_CompilerOptions();
            compilerOptions.ReferencedAssemblies.assert_Not_Empty();
            compilerOptions.NuGet_References.add(targetPackage);

            compilerOptions.mapNuGetReferences(nuGet);

            nuGet.path_Package(targetPackage).assert_Not_Null();
            compilerOptions.ReferencedAssemblies.contains(targetPackage);
            Files.delete_Folder_Recursively(nuGet.Packages_Folder)
                 .assert_True();
        }
 public static CSharp_FastCompiler_CompilerOptions mapNuGetReferences(this CSharp_FastCompiler_CompilerOptions compilerOptions, API_NuGet nuGet)
 {
     foreach(var nugetReference  in compilerOptions.NuGet_References)
     {
         if(nuGet.does_Not_Have_Package(nugetReference))
             nuGet.install(nugetReference);
         var assemmbliesInsideNugetPackage = nuGet.path_Package(nugetReference).files(true,"*.exe", "*.dll");
         if (assemmbliesInsideNugetPackage.empty())
             "[CSharp_FastCompiler_CompilerOptions][mapNuGetReferences] no assemblies found for Nuget package: {0}".error(nugetReference);
         compilerOptions.ReferencedAssemblies.add(assemmbliesInsideNugetPackage);
     }
     return compilerOptions;
 }
        public void resolveCompilationReferencePath()
        {
            //testing NuGet assembly resolution (other parts of resolveCompilationReferencePath are missing)

            var assemblyName = "FluentSharp.HtmlAgilityPack";
            var nuGet =new API_NuGet();
            nuGet.install(assemblyName);
            nuGet.path_Package(assemblyName).assert_Folder_Exists();

            CompileEngine.resolveCompilationReferencePath(assemblyName).assert_File_Exists()
                                                                       .assert_Contains(assemblyName)
                                                                       .fileName().assert_Is(assemblyName.append(".dll"));
        }
Exemple #5
0
 public static bool  does_Not_Have_Package(this API_NuGet nuGet, string packageName)
 {
     return(nuGet.path_Package(packageName).folder_Not_Exists());
 }
Exemple #6
0
 public static bool  has_Package(this API_NuGet nuGet, string packageName)
 {
     return nuGet.path_Package(packageName).folder_Exists();
 }