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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:14:44+00:00 2026-05-26T22:14:44+00:00

I am generating NUnit testcases based on the file names. The directory looks like

  • 0

I am generating NUnit testcases based on the file names.

The directory looks like this:

Customer
    CustomerTestCase1.xml
    CustomerTestCase2.xml

Account
    AccountTestCase1.xml
    AccountTestCase2.xml

I am using TestCaseSource:

    string[] list = Directory.GetFiles(path, "*", SearchOption.AllDirectories)

    foreach (string file in list)
    {
        yield return new TestCaseData(file)
    }

How do I introduce hierarchy into the generated testcases? I need them to be organized in groups according to folder structure, so I could tick “Account” and all the account testcases would be selected.

  • 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-26T22:14:44+00:00Added an answer on May 26, 2026 at 10:14 pm

    Charlie Poole @ NUnit-Discuss

    Hi Andrey,

    If that structure is dynamic, then there is little you can do. However,
    if the structure does not change, then you can simply code multiple
    fixtures, with tests that take data from different sources.

    So you might have a Customer fixture, pulling test data from some
    particular source or sources, and an Account fixture pulling its data
    from other sources.

    Put the common code for these fixtures into a base class so that
    you don’t have to repeat the logic. In fact, it should be easy to
    refactor directly from what you have to use of a base class and
    then to create separate leaf classes for the tests you want to
    select separately.

    Charlie

    http://groups.google.com/group/nunit-discuss/browse_thread/thread/543102e801511c41

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

Sidebar

Related Questions

I'm generating some xml files that needs to conform to an xsd file that
For generating random string i written code like this But if the function is
When generating my DAL files with SubSonic, I'd like the names of the files
Is there a good free plugin for generating a template for Nunit test for
Generating normal columnar data in excel file is quite easy but does any one
Im generating a file to present to the user for download, but the server
I'm generating some XML documents and when it comes to the address part I
I'm generating an unknown amount of checkboxes in my form using mysql, this number
While generating XML files with SimpleXml, I got challengefull problem. I want to make
i m generating a pdf file from the contents of email and that email

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.