There are a few more open issues FIRST OPEN ISSUE: ---------------------- The case is even more complex. The fix for the above is ready but there is one more problem - the confusion about the names of attributes. Look at Name and FullName in the example below. FullName makes sense but the Name doesn’t. Is this intentional? I suggest to introduce new attributes BaseName (or so) and Name to distinguish between the real name and the name of the base class. If I modify the below two files according to our use case - i.e. base class test which uses a virtual method for some modification of data, with the virtual method being overriden in the descendants, the NUnitLiteTests reports 1) TestInheritedShortMethodName (NUnit.Framework.Internal.TestMethodSignatureTes ts.TestInheritedShortMethodName) Expected string length 43 but was 41. Strings differ at index 23. Expected: "InheritanceTestCaseNameLevel2Class.BaseTest" But was: "InheritanceTestCaseNameBaseClass.BaseTest" ----------------------------------^ ----------------------------------^ but this is not correct. I think we should have instead of NUnitFramework/src/testdata/TestMethodSignatureFixture.cs Last modified: 05/11/2012 05:49:04, Status: modified, Kind: file [TestFixture] public abstract class InheritanceTestCaseNameBaseClass { public abstract string GetString(); [Test] public void BaseTest() { Assert.AreEqual("test", this.GetString()); } } [TestFixture] public class InheritanceTestCaseNameLevel1Class : InheritanceTestCaseNameBaseClass { public override string GetString() { return "FailedTest"; } [Test] public void Level1Test() { } } [TestFixture] public class InheritanceTestCaseNameLevel2Class : InheritanceTestCaseNameLevel1Class { public override string GetString() { return "test"; } [Test] public void Level2Test() { } } } } NUnitFramework/src/tests/Internal/TestMethodSignatureTests.cs Last modified: 05/11/2012 06:04:50, Status: modified, Kind: file [Test] public void TestInheritedFullMethodName() { ITestResult result = TestBuilder.RunTestCase(typeof(TestMethodSignatureFixture.InheritanceTestCaseNameLevel2Class), "BaseTest"); Assert.That(result.FullName, Is.EqualTo("NUnit.TestData.TestMethodSignatureFixture.TestMethodSignatureFixture+InheritanceTestCaseNameLevel2Class.BaseTest")); } [Test] public void TestInheritedShortMethodName() { ITestResult result = TestBuilder.RunTestCase(typeof(TestMethodSignatureFixture.InheritanceTestCaseNameLevel2Class), "BaseTest"); ResultSummary summary = new ResultSummary(result); Assert.That(summary.Name, Is.EqualTo("InheritanceTestCaseNameLevel2Class.BaseTest")); } } } SECOND OPEN ISSUE: ======================= I have made some further experiments – changes are at the bottom. In brief, I have introduced a nested class inheritance and created a new file with inheritance. Both share the same names but they are different as their full name is different. What are your thoughts on this? The output of these changes is below 1) TestInheritedFullMethodName (NUnit.Framework.Internal.TestMethodSignatureTest s.TestInheritedFullMethodName) Expected string length 58 but was 85. Strings differ at index 15. Expected: "NUnit.TestData.InheritanceTestCaseNameLevel2Class.BaseTest" But was: "NUnit.TestData.TestMethodSignatureFixture.InheritanceTestCase..." --------------------------^ THIS IS WRONG. FOR SOME REASON THE INVOKED TYPE IS THE NESTED TYPE NUnit.TestData.TestMethodSignatureFixture.xxx rather than NUnit.TestData.InheritanceTestCaseNameLevel2Class at NUnit.Framework.Assert.That[T](T actual, IResolveConstraint expression, St ring message, Object[] args) in d:\src\NUnit\3.0\NUnitFramework\src\framework\As sert.cs:line 392 at NUnit.Framework.Assert.That[T](T actual, IResolveConstraint expression) in d:\src\NUnit\3.0\NUnitFramework\src\framework\Assert.cs:line 358 at NUnit.Framework.Internal.TestMethodSignatureTests.TestInheritedFullMethodN ame() in d:\src\NUnit\3.0\NUnitFramework\src\tests\Internal\TestMethodSignatureT ests.cs:line 219 2) TestInheritedShortMethodName (NUnit.Framework.Internal.TestMethodSignatureTes ts.TestInheritedShortMethodName) Expected string length 43 but was 8. Strings differ at index 0. Expected: "InheritanceTestCaseNameLevel2Class.BaseTest" But was: "BaseTest" -----------^ THIS IS INCONSISTENT WITH THE PREVIOUS EMAIL OUTPUT at NUnit.Framework.Assert.That[T](T actual, IResolveConstraint expression, St ring message, Object[] args) in d:\src\NUnit\3.0\NUnitFramework\src\framework\As sert.cs:line 392 at NUnit.Framework.Assert.That[T](T actual, IResolveConstraint expression) in d:\src\NUnit\3.0\NUnitFramework\src\framework\Assert.cs:line 358 at NUnit.Framework.Internal.TestMethodSignatureTests.TestInheritedShortMethod Name() in d:\src\NUnit\3.0\NUnitFramework\src\tests\Internal\TestMethodSignature Tests.cs:line 229 3) TestNestedInheritedShortMethodName (NUnit.Framework.Internal.TestMethodSignat ureTests.TestNestedInheritedShortMethodName) Expected string length 43 but was 8. Strings differ at index 0. Expected: "InheritanceTestCaseNameLevel2Class.BaseTest" But was: "BaseTest" -----------^ THIS IS INCONSISTENT WITH THE PREVIOUS EMAIL OUTPUT === modified file 'NUnitFramework/src/framework/Internal/Tests/TestMethod.cs' --- NUnitFramework/src/framework/Internal/Tests/TestMethod.cs 2012-09-07 04:08:58 +0000 +++ NUnitFramework/src/framework/Internal/Tests/TestMethod.cs 2012-11-05 05:16:26 +0000 @@ -77,11 +77,6 @@ this.Name = method.Name; this.FullName += "." + this.Name; - // Disambiguate call to base class methods - // TODO: This should not be here - it's a presentation issue - if( method.DeclaringType != method.ReflectedType) - this.Name = method.DeclaringType.Name + "." + method.Name; - // Needed to give proper fullname to test in a parameterized fixture. // Without this, the arguments to the fixture are not included. string prefix = method.ReflectedType.FullName; === modified file 'NUnitFramework/src/testdata/TestMethodSignatureFixture.cs' --- NUnitFramework/src/testdata/TestMethodSignatureFixture.cs 2009-10-28 22:51:26 +0000 +++ NUnitFramework/src/testdata/TestMethodSignatureFixture.cs 2012-11-05 04:49:04 +0000 @@ -119,6 +119,50 @@ public bool TestMethodWithReturnType() { return true; - } + } + + [TestFixture] + public abstract class InheritanceTestCaseNameBaseClass + { + public abstract string GetString(); + + [Test] + public void BaseTest() + { + Assert.AreEqual("test", this.GetString()); + } + } + + + [TestFixture] + public class InheritanceTestCaseNameLevel1Class : InheritanceTestCaseNameBaseClass + { + public override string GetString() + { + return "FailedTest"; + } + + [Test] + public void Level1Test() + { + + } + } + + [TestFixture] + public class InheritanceTestCaseNameLevel2Class : InheritanceTestCaseNameLevel1Class + { + + public override string GetString() + { + return "test"; + } + + [Test] + public void Level2Test() + { + + } + } } } === modified file 'NUnitFramework/src/tests/Internal/TestMethodSignatureTests.cs' --- NUnitFramework/src/tests/Internal/TestMethodSignatureTests.cs 2011-08-11 03:55:25 +0000 +++ NUnitFramework/src/tests/Internal/TestMethodSignatureTests.cs 2012-11-05 05:23:33 +0000 @@ -191,6 +191,43 @@ Assert.That( summary.TestsNotRun, Is.EqualTo(TestMethodSignatureFixture.NotRunnable)); + } + + [Test] + public void TestNestedInheritedFullMethodName() + { + ITestResult result = TestBuilder.RunTestCase(typeof(TestMethodSignatureFixture.InheritanceTestCaseNameLevel2Class), "BaseTest"); + + Assert.That(result.FullName, Is.EqualTo("NUnit.TestData.TestMethodSignatureFixture.TestMethodSignatureFixture+InheritanceTestCaseNameLevel2Class.BaseTest")); + } + + [Test] + public void TestNestedInheritedShortMethodName() + { + ITestResult result = TestBuilder.RunTestCase(typeof(TestMethodSignatureFixture.InheritanceTestCaseNameLevel2Class), "BaseTest"); + + ResultSummary summary = new ResultSummary(result); + + Assert.That(summary.Name, Is.EqualTo("InheritanceTestCaseNameLevel2Class.BaseTest")); + } + + [Test] + public void TestInheritedFullMethodName() + { + ITestResult result = TestBuilder.RunTestCase(typeof(InheritanceTestCaseNameLevel2Class), "BaseTest"); + + Assert.That(result.FullName, Is.EqualTo("NUnit.TestData.InheritanceTestCaseNameLevel2Class.BaseTest")); + } + + [Test] + public void TestInheritedShortMethodName() + { + ITestResult result = TestBuilder.RunTestCase(typeof(InheritanceTestCaseNameLevel2Class), "BaseTest"); + + ResultSummary summary = new ResultSummary(result); + + Assert.That(summary.Name, Is.EqualTo("InheritanceTestCaseNameLevel2Class.BaseTest")); } + } } AND HAVE CREATED A NEW FILE TESTMETHODSIGNATUREININHERITANCE.CS // *********************************************************************** // Copyright (c) 2008 Charlie Poole // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // *********************************************************************** using System; using NUnit.Framework; namespace NUnit.TestData.TestMethodSignatureFixture { [TestFixture] public abstract class InheritanceTestCaseNameBaseClass { public abstract string GetString(); [Test] public void BaseTest() { Assert.AreEqual("test", this.GetString()); } } [TestFixture] public class InheritanceTestCaseNameLevel1Class : InheritanceTestCaseNameBaseClass { public override string GetString() { return "FailedTest"; } [Test] public void Level1Test() { } } [TestFixture] public class InheritanceTestCaseNameLevel2Class : InheritanceTestCaseNameLevel1Class { public override string GetString() { return "test"; } [Test] public void Level2Test() { } } }