Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting MapNotRunnableToFailed to true by default #610

Merged
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
2 changes: 1 addition & 1 deletion src/Adapter/MSTest.CoreAdapter/MSTestSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public MSTestSettings()
{
this.CaptureDebugTraces = true;
this.MapInconclusiveToFailed = false;
this.MapNotRunnableToFailed = false;
this.MapNotRunnableToFailed = true;
this.EnableBaseClassTestMethodsFromOtherAssemblies = true;
this.ForcedLegacyMode = false;
this.TestSettingsFile = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ public void UniTestHelperToTestOutcomeForUnitTestOutcomeErrorShouldReturnTestOut
}

[TestMethod]
public void UniTestHelperToTestOutcomeForUnitTestOutcomeNotRunnableShouldReturnTestOutcomeNone()
public void UniTestHelperToTestOutcomeForUnitTestOutcomeNotRunnableShouldReturnTestOutcomeFailed()
{
var resultOutcome = UnitTestOutcomeHelper.ToTestOutcome(UnitTestOutcome.NotRunnable, this.adapterSettings);
Assert.AreEqual(TestOutcome.None, resultOutcome);
Assert.AreEqual(TestOutcome.Failed, resultOutcome);
}

[TestMethod]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public void MapInconclusiveToFailedIsByDefaultFalseWhenNotSpecified()
}

[TestMethod]
public void MapNotRunnableToFailedIsByDefaultFalseWhenNotSpecified()
public void MapNotRunnableToFailedIsByDefaultTrueWhenNotSpecified()
{
string runSettingxml =
@"<RunSettings>
Expand All @@ -75,7 +75,7 @@ public void MapNotRunnableToFailedIsByDefaultFalseWhenNotSpecified()

MSTestSettings adapterSettings = MSTestSettings.GetSettings(runSettingxml, MSTestSettings.SettingsNameAlias);

Assert.AreEqual(adapterSettings.MapNotRunnableToFailed, false);
Assert.AreEqual(adapterSettings.MapNotRunnableToFailed, true);
}

[TestMethod]
Expand Down Expand Up @@ -887,7 +887,7 @@ public void PopulateSettingsShouldInitializeDefaultAdapterSettingsWhenDiscoveryC
MSTestSettings adapterSettings = MSTestSettings.CurrentSettings;
Assert.AreEqual(adapterSettings.CaptureDebugTraces, true);
Assert.AreEqual(adapterSettings.MapInconclusiveToFailed, false);
Assert.AreEqual(adapterSettings.MapNotRunnableToFailed, false);
Assert.AreEqual(adapterSettings.MapNotRunnableToFailed, true);
Assert.AreEqual(adapterSettings.EnableBaseClassTestMethodsFromOtherAssemblies, true);
}

Expand All @@ -899,7 +899,7 @@ public void PopulateSettingsShouldInitializeDefaultSettingsWhenRunSettingsIsNull
MSTestSettings adapterSettings = MSTestSettings.CurrentSettings;
Assert.AreEqual(adapterSettings.CaptureDebugTraces, true);
Assert.AreEqual(adapterSettings.MapInconclusiveToFailed, false);
Assert.AreEqual(adapterSettings.MapNotRunnableToFailed, false);
Assert.AreEqual(adapterSettings.MapNotRunnableToFailed, true);
Assert.AreEqual(adapterSettings.EnableBaseClassTestMethodsFromOtherAssemblies, true);
}

Expand All @@ -912,7 +912,7 @@ public void PopulateSettingsShouldInitializeDefaultSettingsWhenRunSettingsXmlIsE
MSTestSettings adapterSettings = MSTestSettings.CurrentSettings;
Assert.AreEqual(adapterSettings.CaptureDebugTraces, true);
Assert.AreEqual(adapterSettings.MapInconclusiveToFailed, false);
Assert.AreEqual(adapterSettings.MapNotRunnableToFailed, false);
Assert.AreEqual(adapterSettings.MapNotRunnableToFailed, true);
Assert.AreEqual(adapterSettings.EnableBaseClassTestMethodsFromOtherAssemblies, true);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -292,11 +292,12 @@ public void UniTestHelperToTestOutcomeForUnitTestOutcomeErrorShouldReturnTestOut
}

[TestMethod]
public void UniTestHelperToTestOutcomeForUnitTestOutcomeNotRunnableShouldReturnTestOutcomeNoneWhenNotSpecified()
public void UnitTestHelperToTestOutcomeForUnitTestOutcomeNotRunnableShouldReturnTestOutComeNoneWhenSpecifiedInAdapterSettings()
{
string runSettingxml =
@"<RunSettings>
<MSTestV2>
<MapNotRunnableToFailed>false</MapNotRunnableToFailed>
</MSTestV2>
</RunSettings>";

Expand All @@ -306,6 +307,21 @@ public void UniTestHelperToTestOutcomeForUnitTestOutcomeNotRunnableShouldReturnT
Assert.AreEqual(TestOutcome.None, resultOutcome);
}

[TestMethod]
public void UnitTestHelperToTestOutcomeForUnitTestOutcomeNotRunnableShouldReturnTestOutcomeFailedByDefault()
{
string runSettingxml =
@"<RunSettings>
<MSTestV2>
</MSTestV2>
</RunSettings>";

var adapterSettings = MSTestSettings.GetSettings(runSettingxml, MSTestSettings.SettingsNameAlias);

var resultOutcome = UnitTestOutcomeHelper.ToTestOutcome(UnitTestOutcome.NotRunnable, adapterSettings);
Assert.AreEqual(TestOutcome.Failed, resultOutcome);
}

[TestMethod]
public void UniTestHelperToTestOutcomeForUnitTestOutcomeTimeoutShouldReturnTestOutcomeFailed()
{
Expand Down