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 setup an android test project that runs junit tests. It's using two
Is there a way to have setup/teardown code automagically run before/after each test? Something
I have a test fixture class which is currently used by many tests. #include
I have a unit test (nUnit). Many layers down the call stack a method
We’ve found that the unit tests we’ve written for our C#/C++ code have really
I want to have a good test setup but, I can't find a way
I have this test case def setUp(self): self.user = User.objects.create(username=tauri, password='gaul') def test_loginin_student_control_panel(self): c
Suppose I have several small test cases. Easy enough to setup and easy enough
I have a ubr file setup to stress test an internal DotNetNuke site with
I'm using python-inject , python 2.6 (with unittest2). We have classes to test that

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.