Skip to content
This repository has been archived by the owner on May 17, 2021. It is now read-only.

Commit

Permalink
Issue #4
Browse files Browse the repository at this point in the history
  • Loading branch information
kharnagy committed Feb 28, 2014
1 parent 8b29bbf commit 513ef47
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 3 deletions.
17 changes: 16 additions & 1 deletion NUnitActionEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ internal sealed class NUnitActionEditor : ActionEditorBase
private DropDownList ddlFrameworkVersion;
private ValidatingTextBox txtAdditionalArguments;
private ValidatingTextBox txtCustomXmlOutputPath;
private CheckBox chkTreatInconclusiveTestsAsFailure;

/// <summary>
/// Initializes a new instance of the <see cref="NUnitActionEditor"/> class.
Expand Down Expand Up @@ -81,6 +82,12 @@ protected override void CreateChildControls()
DefaultText = "Managed by BuildMaster"
};

this.chkTreatInconclusiveTestsAsFailure = new CheckBox
{
Text = "Treat Inconclusive Tests as Failures",
Checked = true
};

this.Controls.Add(
new FormFieldGroup(
"NUnit Executable Path",
Expand All @@ -106,6 +113,12 @@ protected override void CreateChildControls()
false,
new StandardFormField("XML Output Path:", this.txtCustomXmlOutputPath)
),
new FormFieldGroup(
"NUnit Options",
"Specify any additional options for NUnit here.",
false,
new StandardFormField("", this.chkTreatInconclusiveTestsAsFailure)
),
new FormFieldGroup(
"Group Name",
"The Group name allows you to easily identify the unit test.",
Expand All @@ -131,6 +144,7 @@ public override void BindToForm(ActionBase extension)
this.ddlFrameworkVersion.SelectedValue = nunitAction.FrameworkVersion ?? "";
this.txtAdditionalArguments.Text = nunitAction.AdditionalArguments;
this.txtCustomXmlOutputPath.Text = nunitAction.CustomXmlOutputPath;
this.chkTreatInconclusiveTestsAsFailure.Checked = nunitAction.TreatInconclusiveAsFailure;
}

public override ActionBase CreateFromForm()
Expand All @@ -142,7 +156,8 @@ public override ActionBase CreateFromForm()
GroupName = this.txtGroupName.Text,
FrameworkVersion = this.ddlFrameworkVersion.SelectedValue,
AdditionalArguments = this.txtAdditionalArguments.Text,
CustomXmlOutputPath = this.txtCustomXmlOutputPath.Text
CustomXmlOutputPath = this.txtCustomXmlOutputPath.Text,
TreatInconclusiveAsFailure = this.chkTreatInconclusiveTestsAsFailure.Checked
};
}
}
Expand Down
12 changes: 10 additions & 2 deletions NUnitAppAction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public sealed class NUnitAppAction : UnitTestActionBase
/// </summary>
public NUnitAppAction()
{
this.TreatInconclusiveAsFailure = true;
}

/// <summary>
Expand Down Expand Up @@ -57,6 +58,12 @@ public NUnitAppAction()
[Persistent]
public string CustomXmlOutputPath { get; set; }

/// <summary>
/// Gets or sets a value indicating whether to treat inconclusive tests as failures.
/// </summary>
[Persistent]
public bool TreatInconclusiveAsFailure { get; set; }

/// <summary>
/// Returns a <see cref="System.String" /> that represents this instance.
/// </summary>
Expand Down Expand Up @@ -114,8 +121,9 @@ protected override void RunTests()
LogInformation(String.Format("NUnit Test: {0} (skipped)", testName));
continue;
}

bool nodeResult = node.Attributes["success"].Value.Equals("True", StringComparison.OrdinalIgnoreCase);

bool nodeResult = node.Attributes["success"].Value.Equals("True", StringComparison.OrdinalIgnoreCase) ||
(!this.TreatInconclusiveAsFailure && node.Attributes["result"].Value.Equals("inconclusive", StringComparison.OrdinalIgnoreCase));

double testLength = double.Parse(node.Attributes["time"].Value);

Expand Down

0 comments on commit 513ef47

Please sign in to comment.