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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T18:04:57+00:00 2026-05-24T18:04:57+00:00

I have created a Hello World program and I am new to C#, My

  • 0

I have created a Hello World program and I am new to C#, My program will print 100 words like that as follow

public static void Main(/*I forgot arguments*/)
{
   string []s=new string [100];
   foreach(string ss in s)
   {
      ss="Hello World";
      Console.WriteLine("{0}\n",ss);      
   }
}

Could you show me step-by-step how to create a test for this program ? Does it need one ? I don’t have an image of how testers do the test. Sorry I am stupid.

I think I have tried my best, no one ever find I find it unworthy to me not to get any help ? I don’t need the class because I forgot the class long ago after the accident.

  • 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-24T18:04:58+00:00Added an answer on May 24, 2026 at 6:04 pm

    First of all, you can’t (or – you shouldn’t) test void methods. You are testing the output of the method – which Main does not have. Second thought: you cannot mock (simulate) an Console object. Read some tutorials about mock and mocking.

    Sample method with sample test could look similar to this:

    public class SimpleCalculator
    {
        public int SumTwoNumbers(int number1, int number2)
        {
            return number1 + number2;
        }
    }
    
    [TestClass]
    public class TestClass
    {
        [TestMethod]
        public void Test_SimpleCalculator_SumTwoNumbers_CorrectValues()
        {
            // Arrange
            SimpleCalculator calc = new SimpleCalculator();
    
            // Act
            int result = calc.SumTwoNumbers(5, 2);
    
            // Assert
            Assert.AreEqual(7, result);
        }
    }
    

    Hope this helped a little.

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

Sidebar

Related Questions

I have created a sample Hello World program in android it was working fine
So I created a simple hello world program that uses ksoap2 on Android 2.3
I have created a Hello World web part. When I pressed F5 in Visual
I have created button 2 below: <input id=Button1 type=button value=Stop onclick=alert('hello world');/> <input id=Button2
So I am trying to run console 64 bit Hello World program. I have
I have started learning Ruby and just tried out my first hello world program
I have created a simple hello world application in xcode using the command line
I have a compiling problem. I followed tutorial about Hello world program for Android
I'm experimenting with internationalization by making a Hello World program that uses properties files
This is my first program I really created besides hello world. The code is

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.