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 780575
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T20:05:43+00:00 2026-05-14T20:05:43+00:00

I have a test setup where I have many very similar unit tests that

  • 0

I have a test setup where I have many very similar unit tests that I need to run. For example, there are about 40 stored procedures that need to be checked for existence in the target environment. However I’d like all the tests to be grouped by their business unit. So there’d be 40 instances of a very similar TestMethod in 40 separate classes. Kinda lame. One other thing: each group of tests need to be in their own solution. So Business Unit A will have a solution called Tests.BusinessUnitA.

I’m thinking that I can set this all up by passing a configuration object (with the name of the stored proc to check, among other things) to a TestRunner class.

The problem is that I’m losing the atomicity of my unit tests. I wouldn’t be able to run just one of the tests, I’d have to run all the tests in the TestRunner class.

This is what the code looks like at this time. Sure, it’s nice and compact, but if Test 8 fails, I have no way of running just Test 8.

  TestRunner runner = new TestRunner(config, this.TestContext);

  var runnerType = typeof(TestRunner);
  var methods = runnerType.GetMethods()
     .Where(x => 
       x.GetCustomAttributes(typeof(TestMethodAttribute), false)
       .Count() > 0).ToArray();

      foreach (var method in methods)
      {
       method.Invoke(runner, null);
      }

So I’m looking for suggestions for making a group of unit tests that take in a configuration object but won’t require me to generate many many TestMethods. This looks like it might require code-generation, but I’d like to solve it without that.

  • 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-05-14T20:05:43+00:00Added an answer on May 14, 2026 at 8:05 pm

    My solution to this was to put all the tests in their own assembly, decorate them with attributes then reflect through the assembly to execute the tests. Made more sense than data driven tests.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a checkstyle suppression filter setup (e.g. ignore magic numbers in unit test
I've created some MbUnit Test Fixtures that have SetUp methods marked with the SetUp
I have a JUnit test that tests adding Strings to a Dictionary custom type.
I currently have a unittest.TestCase that looks like.. class test_appletrailer(unittest.TestCase): def setup(self): self.all_trailers =
I've tryed mylyn but i cant find that feature, if anyone have test mantis
I have a test environment for a database that I want to reload with
I have a test web service replicating a live web service that hasn't been
I have a legacy VB6 application that was built using MSDE. As many client's
I have a number of directories containing the files similar to the below example:
I have started following Test Driven Development and find it very logical and helps

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.