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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T19:29:44+00:00 2026-05-30T19:29:44+00:00

I have one form: FormPrincipal.cs In this form there is a public method called

  • 0

I have one form: FormPrincipal.cs

In this form there is a public method called InsertionSort() taking 2 parameters: a int[] (representing a integer list) and a int represeting the size (number of elements) of the list.
This function simply orders the list using the algorithm “Insertion Sort”

The method doesn’t return anything (because in the logic of my application the list is just ordened and as an array is a point then the original list is just modified to be in the right order).

I’m trying to test if the function order the list.

I created a Unit Test in Visual Studio (not as a separate project) but it always says “failed” without displaying any message. What I’m doing wrong?
The code is like the following:

 [TestMethod()]
    public void InsertionSortTest()
    {
        FormPrincipal target = new FormPrincipal(<some parameters>);
        target.loadData(); // function which load the list to be ordered
        int[] list1 = new int[10];
        list1 = {1,4,3,5,2,6,7,9,8,0);
        target.InsertionSort(list1,10);
        bool listaOrderedOrNot = isListOrdered(list1, 10); // isListOrder is just a function in the same file of the test where I loop the array checking if elements are growing.
        Assert.Inconclusive("A method that does not return a value cannot be verified.");
        // I tried to do the following assert command..
        Assert.AreEqual(listaOrderedOrNot, true,"ordered");
        Assert.IsTrue(listaOrderedOrNot, "ordered");
        Assert.IsFalse(listaOrdenadaOrNot, "NOT ordered");
    }

I suppose it may depends from the fact InsertionSort() doesn’t return anything but Visual Studio doesn’t give errors and no message (for example “ordered” or “NOT ordered”) is printed.

The test just fails when I run it

Thank you for any help

  • 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-30T19:29:45+00:00Added an answer on May 30, 2026 at 7:29 pm

    Remove Assert.Inconclusive("A method that does not return a value cannot be verified.");.
    This basically tells VS that you didn’t implement your test.


    When you have an array you can simply use array.Length to get the size of the array, there is no need to pass the size.


    Your sort algorithm doesn’t belong into the form class.

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

Sidebar

Related Questions

in my project i have one registration form which is developed in C#.net.to this
I have one form as shown below: Page 1: <form name = form1 method=post
I have one form called: MyControlContainerForm ccf and a main form called: SolidForm sf
I have one Windows Form with this.BackColor = Color.Red and this.TransparencyKey = Color.Red and
I have one form calling a method in another form. but the method in
I have one form with several text fields and one button. When i enter
I have one form in a PHP (5.2.9-1) application that causes IIS (Microsoft-IIS/6.0) to
i have one form which have some input box and some select box. i
so here's the problem I have one form, it outputs search results after submit,
IDE: Microsoft Visual Studio Professional 2008 Language: C# Background: I have one form and

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.