Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8939681
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T10:52:20+00:00 2026-06-15T10:52:20+00:00

My unit testing frameworks consists of TestFixtures, TestMethods and Actions. Action is additional smaller

  • 0

My unit testing frameworks consists of TestFixtures, TestMethods and Actions. Action is additional smaller container inside TestMethod, Actions comes from internal Dll written in our company. Actions are used inside methods like that:

[Test]
void TestMethod1()
{
    Run(new Sleep { Seconds = 10 } );
}

I have to write an application, which collect all the information about fixtures, tests and actions from DLL. I have found how to enumerate test fixtures and test methods by reflection using type / method attributes.

But I have no idea how enumerate actions inside test methods.

Could you please help? Is it possible to do using reflection at all?

UPDATED:
See the accepted answer. Really cool library. Also you can look here ( WPF: Binding TreeView in MVVM way step by step tutorial ), if you are interested in how I created entity model for fixtures, tests and actions, and binded in MVVM way to TreeView.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T10:52:21+00:00Added an answer on June 15, 2026 at 10:52 am

    Thanks, Alexei Levenkov! Finally I have found a solution using your tip. Sharing. The only thing you should do -> download and reference Mono.Reflection.dll from https://github.com/jbevain/mono.reflection.

    using System;
    using System.Linq;
    using System.Reflection;
    using MINT;
    using MbUnit.Framework;
    using Mono.Reflection;
    
    namespace TestDll
    {
        internal class Program
        {
            private static void Main(string[] args)
            {
                const string DllPath = @"d:\SprinterAutomation\Actions.Tests\bin\x86\Debug\Actions.Tests.dll";
                Assembly assembly = Assembly.LoadFrom(DllPath);
    
                // enumerating Fixtures
                foreach (Type fixture in assembly.GetTypes().Where(t => t.GetCustomAttributes(typeof(TestFixtureAttribute), false).Length > 0)) 
                {
                    Console.WriteLine(fixture.Name);
                    // enumerating Test Methods
                    foreach (var testMethod in fixture.GetMethods().Where(m => m.GetCustomAttributes(typeof(TestAttribute), false).Length > 0))
                    {
                        Console.WriteLine("\t" + testMethod.Name);
                        // filtering Actions
                        var instructions = testMethod.GetInstructions().Where(
                            i => i.OpCode.Name.Equals("newobj") && ((ConstructorInfo)i.Operand).DeclaringType.IsSubclassOf(typeof(BaseAction)));
    
                        // enumerating Actions!
                        foreach (Instruction action in instructions)
                        {
                            var constructroInfo = action.Operand as ConstructorInfo;
                            Console.WriteLine("\t\t" + constructroInfo.DeclaringType.Name);
                        }
                    }
                }
    
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Are there any unit-testing and mocking frameworks for C# that run on Mono ?
Has any of the alt.net unit testing frameworks embraced .net 4.0 framework?
I'd like to know if there are some unit testing frameworks which are capable
Are the same unit testing frameworks used for different web frameworks - Rails, Merb,
Basically all unit-testing frameworks I've used, be it in C++ or C# (or anything
What frameworks and tools would you recommend for unit-testing and mock objects in Perl?
What are the best unit testing frameworks or libraries for AS3 programming? Specifically for
Like most unit testing frameworks, SenTestCase has setUp and tearDown methods you can override
Are there any unit testing frameworks for Intersystems Caché? If so, please list some.
Are there any good unit testing and acceptance testing frameworks that can be applied

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.