diff --git a/src/Adapter/MSTest.CoreAdapter/Execution/TestAssemblyInfo.cs b/src/Adapter/MSTest.CoreAdapter/Execution/TestAssemblyInfo.cs index 2d0a23e5b9..1a7389279d 100644 --- a/src/Adapter/MSTest.CoreAdapter/Execution/TestAssemblyInfo.cs +++ b/src/Adapter/MSTest.CoreAdapter/Execution/TestAssemblyInfo.cs @@ -97,12 +97,6 @@ public bool HasExecutableCleanupMethod return false; } - // If assembly initialization was successful, then only call assembly cleanup. - if (this.AssemblyInitializationException != null) - { - return false; - } - return true; } } diff --git a/src/Adapter/MSTest.CoreAdapter/Execution/TestClassInfo.cs b/src/Adapter/MSTest.CoreAdapter/Execution/TestClassInfo.cs index 95da9337de..59fa2f8dd7 100644 --- a/src/Adapter/MSTest.CoreAdapter/Execution/TestClassInfo.cs +++ b/src/Adapter/MSTest.CoreAdapter/Execution/TestClassInfo.cs @@ -161,12 +161,6 @@ public bool HasExecutableCleanupMethod return false; } - // If class initialization was successful, then only call class cleanup. - if (this.ClassInitializationException != null) - { - return false; - } - return true; } } diff --git a/test/UnitTests/MSTest.CoreAdapter.Unit.Tests/Execution/TestAssemblyInfoTests.cs b/test/UnitTests/MSTest.CoreAdapter.Unit.Tests/Execution/TestAssemblyInfoTests.cs index 3cb2c5c896..d65e9eefa2 100644 --- a/test/UnitTests/MSTest.CoreAdapter.Unit.Tests/Execution/TestAssemblyInfoTests.cs +++ b/test/UnitTests/MSTest.CoreAdapter.Unit.Tests/Execution/TestAssemblyInfoTests.cs @@ -69,11 +69,12 @@ public void TestAssemblyHasExecutableCleanupMethodShouldReturnFalseIfAssemblyHas } [TestMethod] - public void TestAssemblyHasExecutableCleanupMethodShouldReturnFalseIfAssemblyInitializationThrewAnException() + public void TestAssemblyHasExecutableCleanupMethodShouldReturnTrueEvenIfAssemblyInitializationThrewAnException() { + this.testAssemblyInfo.AssemblyCleanupMethod = this.dummyMethodInfo; this.testAssemblyInfo.AssemblyInitializationException = new NotImplementedException(); - Assert.IsFalse(this.testAssemblyInfo.HasExecutableCleanupMethod); + Assert.IsTrue(this.testAssemblyInfo.HasExecutableCleanupMethod); } [TestMethod] diff --git a/test/UnitTests/MSTest.CoreAdapter.Unit.Tests/Execution/TestClassInfoTests.cs b/test/UnitTests/MSTest.CoreAdapter.Unit.Tests/Execution/TestClassInfoTests.cs index 90deb1ad64..4ed8e3faed 100644 --- a/test/UnitTests/MSTest.CoreAdapter.Unit.Tests/Execution/TestClassInfoTests.cs +++ b/test/UnitTests/MSTest.CoreAdapter.Unit.Tests/Execution/TestClassInfoTests.cs @@ -185,12 +185,12 @@ public void TestClassInfoHasExecutableCleanupMethodShouldReturnFalseIfClassDoesN } [TestMethod] - public void TestClassInfoHasExecutableCleanupMethodShouldReturnFalseIfClassInitializeThrowsAnException() + public void TestClassInfoHasExecutableCleanupMethodShouldReturnTrueEvenIfClassInitializeThrowsAnException() { this.testClassInfo.ClassCleanupMethod = this.testClassType.GetMethods().First(); this.testClassInfo.ClassInitializationException = new NotImplementedException(); - Assert.IsFalse(this.testClassInfo.HasExecutableCleanupMethod); + Assert.IsTrue(this.testClassInfo.HasExecutableCleanupMethod); } [TestMethod]