Merge pull request #4558 from Faizan2304/enablevstest
Enable disabled vstest and test verb test.
This commit is contained in:
commit
f84ce89e30
15 changed files with 260 additions and 86 deletions
|
@ -2,14 +2,6 @@
|
|||
|
||||
namespace TestNamespace
|
||||
{
|
||||
public class Program
|
||||
{
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
[TestClass]
|
||||
public class VSTestTests
|
||||
{
|
||||
|
@ -23,18 +15,18 @@ namespace TestNamespace
|
|||
{
|
||||
Assert.Fail();
|
||||
}
|
||||
|
||||
#if DESKTOP
|
||||
[TestMethod]
|
||||
|
||||
#if DESKTOP
|
||||
[TestMethod]
|
||||
public void VSTestPassTestDesktop()
|
||||
{
|
||||
}
|
||||
#else
|
||||
[TestMethod]
|
||||
#else
|
||||
[TestMethod]
|
||||
public void VSTestFailTestNetCoreApp()
|
||||
{
|
||||
Assert.Fail();
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
}
|
|
@ -1,12 +1,11 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFrameworks>net46</TargetFrameworks>
|
||||
<TargetFrameworks>net46;netcoreapp1.0</TargetFrameworks>
|
||||
</PropertyGroup>
|
||||
|
||||
|
||||
<PropertyGroup Condition="'$(TargetFramework)' == 'net46'">
|
||||
<DefineConstants>DESKTOP;$(DefineConstants)</DefineConstants>
|
||||
</PropertyGroup>
|
||||
|
@ -14,7 +13,7 @@
|
|||
<ItemGroup>
|
||||
<Compile Include="**\*.cs" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp1.0'">
|
||||
<PackageReference Include="Microsoft.NETCore.App">
|
||||
<Version>1.0.1</Version>
|
||||
|
@ -26,14 +25,14 @@
|
|||
<Version>1.0.0-alpha-20161026-2</Version>
|
||||
<PrivateAssets>All</PrivateAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="MSTest.TestFramework">
|
||||
<PackageReference Include="MSTest.TestFramework">
|
||||
<Version>1.0.5-preview</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="MSTest.TestAdapter">
|
||||
<PackageReference Include="MSTest.TestAdapter">
|
||||
<Version>1.1.4-preview</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.TestPlatform.TestHost">
|
||||
<Version>15.0.0-preview-20161028-03</Version>
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk">
|
||||
<Version>15.0.0-preview-20161024-02</Version>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath)\Microsoft.CSharp.targets" />
|
|
@ -2,14 +2,6 @@
|
|||
|
||||
namespace TestNamespace
|
||||
{
|
||||
public class Program
|
||||
{
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
[TestClass]
|
||||
public class VSTestTests
|
||||
{
|
|
@ -1,10 +1,9 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFrameworks>netcoreapp1.0</TargetFrameworks>
|
||||
<TargetFramework>netcoreapp1.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
@ -19,14 +18,14 @@
|
|||
<Version>1.0.0-alpha-20161029-1</Version>
|
||||
<PrivateAssets>All</PrivateAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="MSTest.TestFramework">
|
||||
<PackageReference Include="MSTest.TestFramework">
|
||||
<Version>1.0.5-preview</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="MSTest.TestAdapter">
|
||||
<PackageReference Include="MSTest.TestAdapter">
|
||||
<Version>1.1.4-preview</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.TestPlatform.TestHost">
|
||||
<Version>15.0.0-preview-20161028-03</Version>
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk">
|
||||
<Version>15.0.0-preview-20161024-02</Version>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath)\Microsoft.CSharp.targets" />
|
|
@ -0,0 +1,12 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<packageSources>
|
||||
<!--To inherit the global NuGet package sources remove the <clear/> line below -->
|
||||
<clear />
|
||||
<add key="dotnet-core" value="https://dotnet.myget.org/F/dotnet-core/api/v3/index.json" />
|
||||
<add key="api.nuget.org" value="https://api.nuget.org/v3/index.json" />
|
||||
</packageSources>
|
||||
<activePackageSource>
|
||||
<add key="All" value="(Aggregate source)" />
|
||||
</activePackageSource>
|
||||
</configuration>
|
|
@ -0,0 +1,32 @@
|
|||
using System;
|
||||
using Xunit;
|
||||
|
||||
namespace TestNamespace
|
||||
{
|
||||
public class VSTestXunitTests
|
||||
{
|
||||
[Fact]
|
||||
public void VSTestXunitPassTest()
|
||||
{
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void VSTestXunitFailTest()
|
||||
{
|
||||
Assert.Equal(1, 2);
|
||||
}
|
||||
|
||||
#if DESKTOP
|
||||
[Fact]
|
||||
public void VSTestXunitPassTestDesktop()
|
||||
{
|
||||
}
|
||||
#else
|
||||
[Fact]
|
||||
public void VSTestXunitFailTestNetCoreApp()
|
||||
{
|
||||
Assert.Equal(1, 2);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFrameworks>net46;netcoreapp1.0</TargetFrameworks>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(TargetFramework)' == 'net46'">
|
||||
<DefineConstants>DESKTOP;$(DefineConstants)</DefineConstants>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Include="**\*.cs" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp1.0'">
|
||||
<PackageReference Include="Microsoft.NETCore.App">
|
||||
<Version>1.0.1</Version>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.NET.Sdk">
|
||||
<Version>1.0.0-alpha-20161026-2</Version>
|
||||
<PrivateAssets>All</PrivateAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk">
|
||||
<Version>15.0.0-preview-20161024-02</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="xunit">
|
||||
<Version>2.2.0-beta3-build3402</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="xunit.runner.visualstudio">
|
||||
<Version>2.2.0-beta4-build1188</Version>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
12
TestAssets/TestProjects/VSTestXunitDotNetCore/Nuget.config
Normal file
12
TestAssets/TestProjects/VSTestXunitDotNetCore/Nuget.config
Normal file
|
@ -0,0 +1,12 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<packageSources>
|
||||
<!--To inherit the global NuGet package sources remove the <clear/> line below -->
|
||||
<clear />
|
||||
<add key="dotnet-core" value="https://dotnet.myget.org/F/dotnet-core/api/v3/index.json" />
|
||||
<add key="api.nuget.org" value="https://api.nuget.org/v3/index.json" />
|
||||
</packageSources>
|
||||
<activePackageSource>
|
||||
<add key="All" value="(Aggregate source)" />
|
||||
</activePackageSource>
|
||||
</configuration>
|
19
TestAssets/TestProjects/VSTestXunitDotNetCore/UnitTest1.cs
Normal file
19
TestAssets/TestProjects/VSTestXunitDotNetCore/UnitTest1.cs
Normal file
|
@ -0,0 +1,19 @@
|
|||
using System;
|
||||
using Xunit;
|
||||
|
||||
namespace TestNamespace
|
||||
{
|
||||
public class VSTestXunitTests
|
||||
{
|
||||
[Fact]
|
||||
public void VSTestXunitPassTest()
|
||||
{
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void VSTestXunitFailTest()
|
||||
{
|
||||
Assert.Equal(1, 2);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>netcoreapp1.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Include="**\*.cs" />
|
||||
<EmbeddedResource Include="**\*.resx" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.NETCore.App">
|
||||
<Version>1.0.1</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.NET.Sdk">
|
||||
<Version>1.0.0-alpha-20161026-2</Version>
|
||||
<PrivateAssets>All</PrivateAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk">
|
||||
<Version>15.0.0-preview-20161024-02</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="xunit">
|
||||
<Version>2.2.0-beta3-build3402</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="xunit.runner.visualstudio">
|
||||
<Version>2.2.0-beta4-build1188</Version>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
|
@ -97,7 +97,7 @@
|
|||
|
||||
<!-- Workaround for https://github.com/dotnet/sdk/issues/115 -->
|
||||
<ItemGroup>
|
||||
<HackFilesToCopy Include="$(NuGetPackagesDir)\microsoft.build.runtime\15.1.0-preview-000370-00\contentFiles\any\netcoreapp1.0\**;$(NuGetPackagesDir)\microsoft.codeanalysis.build.tasks\2.0.0-beta6-60922-08\contentFiles\any\any\**;" />
|
||||
<HackFilesToCopy Include="$(NuGetPackagesDir)\microsoft.build.runtime\15.1.0-preview-000370-00\contentFiles\any\netcoreapp1.0\**;$(NuGetPackagesDir)\microsoft.codeanalysis.build.tasks\2.0.0-beta6-60922-08\contentFiles\any\any\**;$(NuGetPackagesDir)\microsoft.testplatform.cli\15.0.0-preview-20161102-02\contentFiles\any\any\**" />
|
||||
</ItemGroup>
|
||||
<Copy SourceFiles="@(HackFilesToCopy)"
|
||||
DestinationFiles="@(HackFilesToCopy->'$(SdkOutputDirectory)/%(RecursiveDir)%(Filename)%(Extension)')" />
|
||||
|
|
|
@ -33,10 +33,10 @@
|
|||
<Version>4.0.0-rc-2037</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.TestPlatform.CLI">
|
||||
<Version>15.0.0-preview-20161005-01</Version>
|
||||
<Version>15.0.0-preview-20161102-02</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.TestPlatform.Build">
|
||||
<Version>15.0.0-preview-20161005-01</Version>
|
||||
<Version>15.0.0-preview-20161028-03</Version>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp1.0' ">
|
||||
|
|
|
@ -2,62 +2,78 @@
|
|||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
|
||||
using Microsoft.DotNet.Tools.Test.Utilities;
|
||||
using Xunit;
|
||||
using FluentAssertions;
|
||||
using Microsoft.DotNet.TestFramework;
|
||||
using Microsoft.DotNet.Cli.Utils;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.IO;
|
||||
using System;
|
||||
|
||||
namespace Microsoft.DotNet.Cli.Test.Tests
|
||||
{
|
||||
public class GivenDotnetTest3BuildsAndRunsTestFromCsprojForMultipleTFM : TestBase
|
||||
{
|
||||
// project targeting net46 will not run in non windows machine.
|
||||
[WindowsOnlyFact(Skip="https://github.com/dotnet/cli/issues/4526")]
|
||||
public void TestsFromAGivenProjectShouldRunWithExpectedOutputForMultiTFM()
|
||||
[WindowsOnlyFact]
|
||||
public void MStestMultiTFM()
|
||||
{
|
||||
// Copy DotNetCoreTestProject project in output directory of project dotnet-vstest.Tests
|
||||
string testAppName = "VSTestDesktopAndNetCoreApp";
|
||||
// Copy VSTestDesktopAndNetCore project in output directory of project dotnet-test.Tests
|
||||
string testAppName = "VSTestDesktopAndNetCore";
|
||||
TestInstance testInstance = TestAssetsManager.CreateTestInstance(testAppName);
|
||||
|
||||
string testProjectDirectory = testInstance.TestRoot;
|
||||
|
||||
// Restore project VSTestDesktopAndNetCoreApp
|
||||
// Restore project VSTestDesktopAndNetCore
|
||||
new RestoreCommand()
|
||||
.WithWorkingDirectory(testProjectDirectory)
|
||||
.Execute()
|
||||
.Should()
|
||||
.Pass();
|
||||
|
||||
// Call test3
|
||||
// Call test
|
||||
CommandResult result = new DotnetTestCommand()
|
||||
.WithWorkingDirectory(testProjectDirectory)
|
||||
.ExecuteWithCapturedOutput("--diag LogFile.txt");
|
||||
.ExecuteWithCapturedOutput();
|
||||
|
||||
|
||||
// Verify
|
||||
// for target framework net46
|
||||
try
|
||||
{
|
||||
result.StdOut.Should().Contain("Total tests: 3. Passed: 2. Failed: 1. Skipped: 0.");
|
||||
result.StdOut.Should().Contain("Passed TestNamespace.VSTestTests.VSTestPassTestDesktop");
|
||||
}
|
||||
catch
|
||||
{
|
||||
string logfile1 = Path.Combine(testProjectDirectory,"LogFile.txt");
|
||||
string[] logfile2 = Directory.GetFiles(testProjectDirectory, "LogFile.host.*");
|
||||
|
||||
System.Console.WriteLine("**********************************Vstest.console Log****************************************************************");
|
||||
System.Console.WriteLine(File.ReadAllText(logfile1));
|
||||
System.Console.WriteLine("**********************************TestHost Log****************************************************************");
|
||||
System.Console.WriteLine(logfile2.Length>0 ? File.ReadAllText(logfile2[0]):"No log file found");
|
||||
System.Console.WriteLine("**************************************************************************************************");
|
||||
}
|
||||
result.StdOut.Should().Contain("Total tests: 3. Passed: 2. Failed: 1. Skipped: 0.");
|
||||
result.StdOut.Should().Contain("Passed TestNamespace.VSTestTests.VSTestPassTestDesktop");
|
||||
|
||||
// for target framework netcoreapp1.0
|
||||
//result.StdOut.Should().Contain("Total tests: 3. Passed: 1. Failed: 2. Skipped: 0.");
|
||||
//result.StdOut.Should().Contain("Failed TestNamespace.VSTestTests.VSTestFailTestNetCoreApp");
|
||||
result.StdOut.Should().Contain("Total tests: 3. Passed: 1. Failed: 2. Skipped: 0.");
|
||||
result.StdOut.Should().Contain("Failed TestNamespace.VSTestTests.VSTestFailTestNetCoreApp");
|
||||
}
|
||||
|
||||
[WindowsOnlyFact]
|
||||
public void XunitMultiTFM()
|
||||
{
|
||||
// Copy VSTestXunitDesktopAndNetCore project in output directory of project dotnet-test.Tests
|
||||
string testAppName = "VSTestXunitDesktopAndNetCore";
|
||||
TestInstance testInstance = TestAssetsManager.CreateTestInstance(testAppName);
|
||||
|
||||
string testProjectDirectory = testInstance.TestRoot;
|
||||
|
||||
// Restore project VSTestXunitDesktopAndNetCore
|
||||
new RestoreCommand()
|
||||
.WithWorkingDirectory(testProjectDirectory)
|
||||
.Execute()
|
||||
.Should()
|
||||
.Pass();
|
||||
|
||||
// Call test
|
||||
CommandResult result = new DotnetTestCommand()
|
||||
.WithWorkingDirectory(testProjectDirectory)
|
||||
.ExecuteWithCapturedOutput();
|
||||
|
||||
// Verify
|
||||
// for target framework net46
|
||||
result.StdOut.Should().Contain("Total tests: 3. Passed: 2. Failed: 1. Skipped: 0.");
|
||||
result.StdOut.Should().Contain("Passed TestNamespace.VSTestXunitTests.VSTestXunitPassTestDesktop");
|
||||
|
||||
// for target framework netcoreapp1.0
|
||||
result.StdOut.Should().Contain("Total tests: 3. Passed: 1. Failed: 2. Skipped: 0.");
|
||||
result.StdOut.Should().Contain("Failed TestNamespace.VSTestXunitTests.VSTestXunitFailTestNetCoreApp");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,16 +13,16 @@ namespace Microsoft.DotNet.Cli.Test.Tests
|
|||
{
|
||||
public class GivenDotnettestBuildsAndRunsTestfromCsproj : TestBase
|
||||
{
|
||||
//[Fact]
|
||||
public void TestsFromAGivenProjectShouldRunWithExpectedOutput()
|
||||
[Fact]
|
||||
public void MSTestSingleTFM()
|
||||
{
|
||||
// Copy DotNetCoreTestProject project in output directory of project dotnet-vstest.Tests
|
||||
string testAppName = "VSTestDotNetCoreProject";
|
||||
// Copy VSTestDotNetCore project in output directory of project dotnet-vstest.Tests
|
||||
string testAppName = "VSTestDotNetCore";
|
||||
TestInstance testInstance = TestAssetsManager.CreateTestInstance(testAppName);
|
||||
|
||||
string testProjectDirectory = testInstance.TestRoot;
|
||||
|
||||
// Restore project VSTestDotNetCoreProject
|
||||
// Restore project VSTestDotNetCore
|
||||
new RestoreCommand()
|
||||
.WithWorkingDirectory(testProjectDirectory)
|
||||
.Execute()
|
||||
|
@ -32,7 +32,7 @@ namespace Microsoft.DotNet.Cli.Test.Tests
|
|||
// Call test
|
||||
CommandResult result = new DotnetTestCommand()
|
||||
.WithWorkingDirectory(testProjectDirectory)
|
||||
.ExecuteWithCapturedOutput("/p:TargetFramework=netcoreapp1.0");
|
||||
.ExecuteWithCapturedOutput();
|
||||
|
||||
// Verify
|
||||
result.StdOut.Should().Contain("Total tests: 2. Passed: 1. Failed: 1. Skipped: 0.");
|
||||
|
@ -40,16 +40,43 @@ namespace Microsoft.DotNet.Cli.Test.Tests
|
|||
result.StdOut.Should().Contain("Failed TestNamespace.VSTestTests.VSTestFailTest");
|
||||
}
|
||||
|
||||
//[Fact]
|
||||
public void TestWillNotBuildTheProjectIfNoBuildArgsIsGiven()
|
||||
[Fact]
|
||||
public void XunitSingleTFM()
|
||||
{
|
||||
// Copy DotNetCoreTestProject project in output directory of project dotnet-vstest.Tests
|
||||
string testAppName = "VSTestDotNetCoreProject";
|
||||
// Copy VSTestXunitDotNetCore project in output directory of project dotnet-vstest.Tests
|
||||
string testAppName = "VSTestXunitDotNetCore";
|
||||
TestInstance testInstance = TestAssetsManager.CreateTestInstance(testAppName);
|
||||
|
||||
string testProjectDirectory = testInstance.TestRoot;
|
||||
|
||||
// Restore project VSTestDotNetCoreProject
|
||||
// Restore project VSTestXunitDotNetCore
|
||||
new RestoreCommand()
|
||||
.WithWorkingDirectory(testProjectDirectory)
|
||||
.Execute()
|
||||
.Should()
|
||||
.Pass();
|
||||
|
||||
// Call test
|
||||
CommandResult result = new DotnetTestCommand()
|
||||
.WithWorkingDirectory(testProjectDirectory)
|
||||
.ExecuteWithCapturedOutput();
|
||||
|
||||
// Verify
|
||||
result.StdOut.Should().Contain("Total tests: 2. Passed: 1. Failed: 1. Skipped: 0.");
|
||||
result.StdOut.Should().Contain("Passed TestNamespace.VSTestXunitTests.VSTestXunitPassTest");
|
||||
result.StdOut.Should().Contain("Failed TestNamespace.VSTestXunitTests.VSTestXunitFailTest");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void TestWillNotBuildTheProjectIfNoBuildArgsIsGiven()
|
||||
{
|
||||
// Copy VSTestDotNetCore project in output directory of project dotnet-vstest.Tests
|
||||
string testAppName = "VSTestDotNetCore";
|
||||
TestInstance testInstance = TestAssetsManager.CreateTestInstance(testAppName);
|
||||
|
||||
string testProjectDirectory = testInstance.TestRoot;
|
||||
|
||||
// Restore project VSTestDotNetCore
|
||||
new RestoreCommand()
|
||||
.WithWorkingDirectory(testProjectDirectory)
|
||||
.Execute()
|
||||
|
@ -58,10 +85,10 @@ namespace Microsoft.DotNet.Cli.Test.Tests
|
|||
|
||||
string configuration = Environment.GetEnvironmentVariable("CONFIGURATION") ?? "Debug";
|
||||
string expectedError = Path.Combine(testProjectDirectory, "bin",
|
||||
configuration, "netcoreapp1.0", "VSTestDotNetCoreProject.dll");
|
||||
configuration, "netcoreapp1.0", "VSTestDotNetCore.dll");
|
||||
expectedError = "The test source file " + "\"" + expectedError + "\"" + " provided was not found.";
|
||||
|
||||
// Call test3
|
||||
// Call test
|
||||
CommandResult result = new DotnetTestCommand()
|
||||
.WithWorkingDirectory(testProjectDirectory)
|
||||
.ExecuteWithCapturedOutput("--noBuild");
|
||||
|
|
|
@ -13,23 +13,23 @@ namespace Microsoft.DotNet.Cli.VSTest.Tests
|
|||
{
|
||||
public class VSTestTests : TestBase
|
||||
{
|
||||
[Fact(Skip="https://github.com/dotnet/cli/issues/4526")]
|
||||
[Fact]
|
||||
public void TestsFromAGivenContainerShouldRunWithExpectedOutput()
|
||||
{
|
||||
// Copy DotNetCoreTestProject project in output directory of project dotnet-vstest.Tests
|
||||
string testAppName = "VSTestDotNetCoreProject";
|
||||
// Copy VSTestDotNetCore project in output directory of project dotnet-vstest.Tests
|
||||
string testAppName = "VSTestDotNetCore";
|
||||
TestInstance testInstance = TestAssetsManager.CreateTestInstance(testAppName);
|
||||
|
||||
string testProjectDirectory = testInstance.TestRoot;
|
||||
|
||||
// Restore project VSTestDotNetCoreProject
|
||||
// Restore project VSTestDotNetCore
|
||||
new RestoreCommand()
|
||||
.WithWorkingDirectory(testProjectDirectory)
|
||||
.Execute()
|
||||
.Should()
|
||||
.Pass();
|
||||
|
||||
// Build project VSTestDotNetCoreProject
|
||||
// Build project VSTestDotNetCore
|
||||
new BuildCommand()
|
||||
.WithWorkingDirectory(testProjectDirectory)
|
||||
.Execute()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue