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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T17:44:03+00:00 2026-05-31T17:44:03+00:00

I am working with teamcity and and moving some old integration tests over to

  • 0

I am working with teamcity and and moving some old integration tests over to it. These old integration tests just logged the results as a console application. I would stay with just logging the results but, teamcity has nice support for NUnit and would like to take advantage of it.

Lets say this was one of my old tests

    public void Test ()
    {
        int tries = 10;
        int fails = Check(tries);

        Console.WriteLine("{0} fails out of {1} attempts", fails, tries); // log results
    }

    public int Check (int tries)
    {
        int fails = 0;
        for (int i = 0; i < tries; i++)
        {
            if (i % 2 == 1) fails++;
        }
        return fails;
    }

I am not sure how to do this with NUnit or if it’s even possible. I want each call of Check to be it’s own test. And no, blocking out 10 tests to call Check (n) n = 0, … n = 9 is not what I’m looking for.

Thanks in advance.

  • 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-31T17:44:05+00:00Added an answer on May 31, 2026 at 5:44 pm

    You can make use of NUnit’s data-driven tests.

     [TestCase(10, Result = 5)]
     public int Check (int tries)
        {
        int fails = 0;
        for (int i = 0; i < tries; i++)
        {
            if (i % 2 == 1) fails++;
        }
        return fails;
     }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working on a K2 project and use the TeamCity as Continuous Integration
I installed TeamCity and got it working against my project. However, I have since
Just installed teamcity 6.5.6 after uninstalling 6.5.4 after trying to implement a svn 1.7
Can someone offer me some advice on TeamCity+CI+Deployment So far my it feels rubbish
I am working on Teamcity 6.5.6, and looking for a way to automatically install
I am using TeamCity 4.5.1 to build and deploy an ASP.Net application to development.
Working with an API where I need to send a value over in an
I'm working on a C#/VB.Net project that uses SVN and TeamCity build server. A
The project I'm working on has a bunch of service-tier unit tests using Microsoft.VisualStudio.TestTools.UnitTesting.TestMethodAttribute.
I have an Asp.Net MVC Web Application that I am developing. I have TeamCity

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.