From b13a7cee50c9a9f42f39f166d33e88278b361aec Mon Sep 17 00:00:00 2001 From: Faizan Ahmad Date: Tue, 1 Nov 2016 17:17:45 +0530 Subject: [PATCH] Enable Vstest test --- test/dotnet-vstest.Tests/VSTestTests.cs | 32 ++++++++++++------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/test/dotnet-vstest.Tests/VSTestTests.cs b/test/dotnet-vstest.Tests/VSTestTests.cs index 5d3e46c30..e3d685090 100644 --- a/test/dotnet-vstest.Tests/VSTestTests.cs +++ b/test/dotnet-vstest.Tests/VSTestTests.cs @@ -30,25 +30,25 @@ namespace Microsoft.DotNet.Cli.VSTest.Tests .Pass(); // Build project VSTestDotNetCoreProject - //new BuildCommand() - // .WithWorkingDirectory(testProjectDirectory) - // .Execute() - // .Should() - // .Pass(); + new BuildCommand() + .WithWorkingDirectory(testProjectDirectory) + .Execute() + .Should() + .Pass(); - //// Prepare args to send vstest - //string configuration = Environment.GetEnvironmentVariable("CONFIGURATION") ?? "Debug"; - //string testAdapterPath = Path.Combine(testProjectDirectory, "bin", configuration, "netcoreapp1.0"); - //string outputDll = Path.Combine(testAdapterPath, $"{testAppName}.dll"); - //string argsForVstest = string.Concat("\"", outputDll, "\""); + // Prepare args to send vstest + string configuration = Environment.GetEnvironmentVariable("CONFIGURATION") ?? "Debug"; + string testAdapterPath = Path.Combine(testProjectDirectory, "bin", configuration, "netcoreapp1.0"); + string outputDll = Path.Combine(testAdapterPath, $"{testAppName}.dll"); + string argsForVstest = string.Concat("\"", outputDll, "\""); - //// Call vstest - //CommandResult result = new VSTestCommand().ExecuteWithCapturedOutput(argsForVstest); + // Call vstest + CommandResult result = new VSTestCommand().ExecuteWithCapturedOutput(argsForVstest); - //// Verify - //result.StdOut.Should().Contain("Total tests: 2. Passed: 1. Failed: 1. Skipped: 0."); - //result.StdOut.Should().Contain("Passed TestNamespace.VSTestTests.VSTestPassTest"); - //result.StdOut.Should().Contain("Failed TestNamespace.VSTestTests.VSTestFailTest"); + // Verify + result.StdOut.Should().Contain("Total tests: 2. Passed: 1. Failed: 1. Skipped: 0."); + result.StdOut.Should().Contain("Passed TestNamespace.VSTestTests.VSTestPassTest"); + result.StdOut.Should().Contain("Failed TestNamespace.VSTestTests.VSTestFailTest"); } } }