예제 #1
0
        static void NetStandardTestCore(string tmpDir, bool full)
        {
            if (!File.Exists("/usr/local/share/dotnet/dotnet"))
            {
                Assert.Ignore(".NET Core SDK not installed");
            }

            TI.UnifiedTestConfig config = new TI.UnifiedTestConfig(tmpDir);

            string netStandardProject = TI.GenerateNetStandardProject(config);

            TI.RunAndAssert("/usr/local/share/dotnet/dotnet", $"restore {netStandardProject}", "Restore");
            TI.BuildProject(netStandardProject, true, useMSBuild: true);

            config.ItemGroup = $@"
<ItemGroup>
	<ProjectReference Include=""NetStandard\NetStandardLib.csproj"">
		<Project>{{BEC2D25A-A590-4858-8E07-849539D168B1}}</Project>
		<Name>NetStandardLib</Name>
	</ProjectReference>
</ItemGroup>
";

            if (full)
            {
                config.TargetFrameworkVersion = "<TargetFrameworkVersion>4.6.1</TargetFrameworkVersion>";
            }

            config.TestCode     = "var test = new NetStandardLib.Class1 ().TestMethod ();";
            config.CSProjConfig = "<MonoBundlingExtraArgs>--registrar=dynamic</MonoBundlingExtraArgs>";
            config.XM45         = full;

            TI.TestUnifiedExecutable(config, useMSBuild: true);
        }
예제 #2
0
        static void NetStandardTestCore(string tmpDir, bool full)
        {
            if (!File.Exists("/usr/local/share/dotnet/dotnet"))
            {
                Assert.Ignore(".NET Core SDK not installed");
            }

            TI.UnifiedTestConfig config = new TI.UnifiedTestConfig(tmpDir);

            string netStandardProject = TI.GenerateNetStandardProject(config);

            var environment = new Dictionary <string, string> {
                { "MSBUILD_EXE_PATH", null },
                { "MSBuildExtensionsPathFallbackPathsOverride", null },
                { "MSBuildSDKsPath", null },
            };

            TI.RunAndAssert("/usr/local/share/dotnet/dotnet", new [] { "restore", netStandardProject }, "Restore", environment: environment);
            TI.BuildProject(netStandardProject);

            config.ItemGroup = $@"
<ItemGroup>
	<ProjectReference Include=""NetStandard\NetStandardLib.csproj"">
		<Project>{{BEC2D25A-A590-4858-8E07-849539D168B1}}</Project>
		<Name>NetStandardLib</Name>
	</ProjectReference>
</ItemGroup>
";

            if (full)
            {
                config.TargetFrameworkVersion = "<TargetFrameworkVersion>4.6.1</TargetFrameworkVersion>";
            }

            config.TestCode     = "var test = new NetStandardLib.Class1 ().TestMethod ();";
            config.CSProjConfig = "<MonoBundlingExtraArgs>--registrar=dynamic</MonoBundlingExtraArgs>";
            config.XM45         = full;

            TI.TestUnifiedExecutable(config);
        }