Need HELP on CSHARP method

Write a method that will take an array of randomly generated data that has NOT been checked for being unique and count the number of duplicated numbers in the array. you can call on the sort routine if you wish.

here’s what ive gotten so far satisfying a linear search file builder and tester:

class Program
{
static void Main(string[] args)
{
Random rand = new Random();
int[] testList = { 2, 3, 4, 1, 5, 8, 9, 7, 6, 0 };
int location;

        // testing section - Part 1
        for (int i = 0; i < 10; i++)
        {
            location = linearSearch(testList, i, 10);
            Console.WriteLine("The number " + i + " was found in position " + location);
        }
        location = linearSearch(testList, 43, 10);
        Console.WriteLine("The number 43 was found in position " + location);

        // generate data - Part 2
        int[] list = new int[1000];
        list[0] = rand.Next(1, 5000);

        Console.ReadKey();

    }

    static int linearSearch(int[] list, int sKey, int lim)
    {
        bool searching = true;
        int ptr = lim - 1;
        while (searching)
        {
            if (list[ptr] == sKey)
            {
                searching = false;
            }
            else
            {
                ptr--;
                if (ptr < 0)
                {
                    searching = false;
                }
            }
        }
        return ptr;
    } // linear search

    static void buildUniqueList(int[] list)
    {
        Random rand = new Random();
        int ptr = 1;
        int result;
        int temp;
        // fill first location with a random number
        list[0] = rand.Next(1, 5000);

        //fill res of array with unique numbers between 1 and 5000

        while (ptr < list.Length)
        {
            //generate another random number
            temp = rand.Next(1, 5000);
            //test temp with linear search
            result = linearSearch(list, temp, ptr);

            if (result == -1)// if not found
            {
                list[ptr] = temp;
                ptr++;
            }
        }
    }


    // sort mathod
    static void sort(int[] list)
    {
        int ptr, minValue, minPosition;

        ptr = 0;
        for (int i = ptr; i < list.Length - 1; i++)
        {
            minValue = list*;
            minPosition = i;
            for (int j = i; j < list.Length; j++)
            {
                if (list[j] < minValue)
                {
                    minValue = list[j];
                    minPosition = j;
                }

            } // inner sort for
            swap(list, ptr, minPosition);
            ptr++;
        } // outer sort for
    } // sort function

    // swap method for two items in an array
    static void swap(int[] list, int ptr1, int ptr2)
    {
        int temp = list[ptr1];
        list[ptr1] = list[ptr2];
        list[ptr2] = temp;
    }  // swap

    //test unique
    static bool testUnique(int[] list)
    {
        Array.Sort(list);
        bool unique = true;
        int ctr = 0;

        while (unique)
        {
            if (list[ctr] == list[ctr + 1])
                unique = false;
        }

        {
            if (list[ctr] == (list.Length - 1))

                return unique;

                
        }
            return unique;

    }

   


    



}

}