[TestFixture] public class MyTests { [Test] public void TestMethod1() { // test code } [Test] public void TestMethod2() { // test code } } [TestFixture] public class MyTestsTests { [Test] public void ListAllTestMethods() { var testMethods = TestBuilder.MakeFixture(typeof(MyTests)).GetTestMethods(); foreach (var testMethod in testMethods) { Console.WriteLine(testMethod.MethodInfo.Name); } } }
[TestFixture] public class MyTests { [Test] public void TestMethod1() { // test code } [Test] public void TestMethod2() { // test code } } [TestFixture] public class MyTestsTests { [Test] public void ListAllTestMethods() { var fixture = new TestFixture(typeof(MyTests)); foreach (var testMethod in fixture.Tests) { Console.WriteLine(testMethod.MethodName); } } }This code example also demonstrates how to use the List All feature to retrieve the test methods in the `MyTests` test fixture. The output will be a list of method names, `TestMethod1` and `TestMethod2`. Package library: NUnit.Framework