How to test a method (White box testing)
<p>Here's the method I want to test</p>

<pre><code>    private static void selectTop20Tags(Dictionary&lt;string, int&gt; list)
    {

         //Outputs the top 20 most common hashtags in descending order
         foreach (KeyValuePair&lt;string, int&gt; pair in list.OrderByDescending(key =&gt; key.Value).Take(20))
         {
             Console.WriteLine("{0}, {1}", pair.Key, pair.Value);
         }

    }
</code></pre>

<p>I don't know how I would test this, I've been researching it all day and try various things but cannot get it to work.</p>

<p>I was thinking of including some code such as </p>

<pre><code>#if TEST
            if ((length of list don't know how you would do it) &lt;= 20)
            {
                StreamWriter log2;
                // appends file
                log2 = File.AppendText("logOfTests.txt");
                // Writes to the file
                log2.WriteLine("PASS");
                log2.WriteLine();

                // Closes the stream
                log2.Close();
            }
#endif
</code></pre>

<p>I think I just need to see an example and I would know.</p>
