Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/NUnit.Engine.Api.Tests/PackageSettingsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,16 @@ public static void LookupSettingDefinitionFails()
Assert.That(lookup, Is.Null);
}

[TestCase("RequestedAgentType")]
[TestCase("SelectedAgentType")]
public static void AgentTypeSettingIsAnEmptyStringByDefault(string name)
{
var definition = SettingDefinitions.Lookup(name);

Assert.That(definition, Is.TypeOf<SettingDefinition<string>>());
Assert.That(((SettingDefinition<string>)definition).DefaultValue, Is.Empty);
}

[Test]
public void AddKnownSettingUsingSettingDefinition()
{
Expand Down
15 changes: 15 additions & 0 deletions src/NUnit.Engine.Api/SettingDefinitions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,21 @@ static SettingDefinitions()
/// </summary>
public static SettingDefinition<string> SelectedAgentName { get; } = new(nameof(SelectedAgentName), string.Empty);

/// <summary>
/// Indicates the type of agent requested by the user. Values are the
/// names of <see cref="TestAgentType"/> members: "InProcess",
/// "LocalProcess" and "RemoteProcess". If not specified, any type
/// of agent may be used, except that tests only run in-process
/// when that is requested.
/// </summary>
public static SettingDefinition<string> RequestedAgentType { get; } = new(nameof(RequestedAgentType), string.Empty);

/// <summary>
/// Indicates the type of agent that was actually used, as the name
/// of a <see cref="TestAgentType"/> member.
/// </summary>
public static SettingDefinition<string> SelectedAgentType { get; } = new(nameof(SelectedAgentType), string.Empty);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the symmetry of the names with the two agent name settings.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. That was the aim: each type setting sits beside the name setting it pairs with, so a runner can read them together.

/// <summary>
/// Bool flag indicating that the test should be run in a 32-bit process
/// on a 64-bit system. By default, NUNit runs in a 64-bit process on
Expand Down