Skip to content

Commit

Permalink
Setting MapNotRunnableToFailed to true by default (#610)
Browse files Browse the repository at this point in the history
* Setting MapNotRunnableToFailed to true by default

* Review comments addressed
  • Loading branch information
vagisha-nidhi authored Apr 29, 2019
1 parent c3d352c commit ed79669
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 9 deletions.
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

0 comments on commit ed79669

Please sign in to comment.