Enable Vstest test

This commit is contained in:
Faizan Ahmad 2016-11-01 17:17:45 +05:30
parent 1b5497afda
commit b13a7cee50

View file

@ -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");
}
}
}