You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to get dotnet test to pass command line parameters into my unit tests so that I can keep from using settings files.
Steps to reproduce
// In the Assembly init test class
[AssemblyInitialize]
public static void AssemblyInitialize(TestContext context)
{
Console.WriteLine($"Test Assembly initialized with properties: {string.Join(",", context.Properties.Keys)}");
}
// In the normal Test Class
[ClassInitialize]
public static void ClassInitialize(TestContext context)
{
Console.WriteLine($"Test class initialized with properties: {string.Join(",", context.Properties.Keys)}");
}
[TestMethod]
public void TestAlwaysErrors()
{
Assert.IsFalse(true);
}
// Command line to invoke: dotnet test -v d --diag C:\Temp\testoutput.txt -- TestRunParameters.Foo=Bar
Expected behavior in console
Standard Output Messages:
Test Assembly initialized with properties: FullyQualifiedTestClassName,TestName,Foo
Test class initialized with properties: FullyQualifiedTestClassName,TestName,Foo
Actual behavior in console
Standard Output Messages:
Test Assembly initialized with properties: FullyQualifiedTestClassName,TestName
Test class initialized with properties: FullyQualifiedTestClassName,TestName
I noticed the diagnostic file in C:\Temp\testoutput.txt mentions the generated runsettings file with the TestRunParameter xml entry plus child entry of Foo, but using procmon it does not seem like this file is passed into the execution in any way.
Am I missing something?
Environment data
dotnet --info output:
.NET Command Line Tools (1.0.3)
Product Information:
Version: 1.0.3
Commit SHA-1 hash: 37224c9917
Runtime Environment:
OS Name: Windows
OS Version: 10.0.14393
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\1.0.3
Copied from original issue: dotnet/cli#6855
The text was updated successfully, but these errors were encountered:
@jhgoodwin : if you will run the command dotnet test -v d --diag C:\Temp\testoutput.txt -- TestRunParameters.Foo=Bar it will update the runsettings with
From @jhgoodwin on June 13, 2017 20:29
Overview
I am trying to get
dotnet test
to pass command line parameters into my unit tests so that I can keep from using settings files.Steps to reproduce
// In the normal Test Class
// Command line to invoke:
dotnet test -v d --diag C:\Temp\testoutput.txt -- TestRunParameters.Foo=Bar
Expected behavior in console
Actual behavior in console
I noticed the diagnostic file in C:\Temp\testoutput.txt mentions the generated runsettings file with the TestRunParameter xml entry plus child entry of Foo, but using procmon it does not seem like this file is passed into the execution in any way.
Am I missing something?
Environment data
dotnet --info
output:Copied from original issue: dotnet/cli#6855
The text was updated successfully, but these errors were encountered: