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

  • Home
  • SEARCH
  • 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 7627473
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T05:27:51+00:00 2026-05-31T05:27:51+00:00

There are 2 tests that take the same list of servers in using the

  • 0

There are 2 tests that take the same list of servers in using the Row() attribute

Is there a way to avoid duplicating all the Row attributes on both tests?

[RowTest]
[Row("server1")]
[Row("server2")]
[Row("server3")]
public void Test1(string server)
{
    //try connecting on port
}

[RowTest]
[Row("server1")]
[Row("server2")]
[Row("server3")]
public void Test2(string server)
{
   //ping server
}
  • 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-31T05:27:51+00:00Added an answer on May 31, 2026 at 5:27 am

    Yes. You can define a source for the test cases. The source can be either a method, field or a property, may be static or instance. The requirement is that the source should return an IEnumberable or another type that implements it. Of course the sources are reusable for multiple test methods which is your requirement.

    You indicate the source for test cases by decorating the method with the TestCaseSourceAttribute. The snippet below is an example from the link I provided.

    static int[] EvenNumbers = new int[] { 2, 4, 6, 8 };
    
    [Test, TestCaseSource("EvenNumbers")]
    public void TestMethod(int num)
    {
        Assert.IsTrue( num % 2 == 0 );
    }
    

    Also take into consideration that in the latest verion of NUnit, the is no Row or RowTest attribute, for more information visit this question: What happended to nunit extensions/rowtest?

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

Sidebar

Related Questions

Is there any way to group tests in JUnit, so that I can run
Is there any reason for automating tests that focus on GUI (and not to
In .NET is there a function that tests if a string is syntactically a
Are there any guidelines on writing database tests so that you can refactor database
Is there any website which provides core java based programming challenges that tests programming
Is there an easy way to check in a unit test that two arrays
I am looking for a function that will take a list of options in
I have a few Silverlight UI tests that I'm automating with White. These tests
There was an interesting question in a practice test that I did not understand
Is there a good test suite or tool set that can automate website navigation

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.