title: unit testing a static Main() method in c#
body: <p>I am trying to write unit tests using visual studio unit testing framework for a static Main method, which is also my entry point to my application. I have my method as follows. </p>
  
  <pre><code>public static void Main()
          {
              StructureMapBootstrapper.Register();
              SetupFilter&lt;Applicant&gt;();
          }
  </code></pre>
  
  <p>and this calls a generic SetupFilter method</p>
  
  <pre><code>private static void SetupFilter&lt;T&gt;() where T : IDataFilterBase, new()
          {
              var filterName = typeof(T).Name;
              if ("StartReceiver".TryGetTrueOrFalseConfigValue(filterName))
              {
                  ObjectFactory.Configure(x =&gt; x.For&lt;IDataFilterBase&gt;().Use&lt;T&gt;());
                  var filter = new T();
                  filter.StartReceiver();
                  LogHelper.LogInfo(string.Format("Started {0} Filter Service", filterName));
              }
              else
              {
                  LogHelper.LogInfo(string.Format("{0} Filter Service NOT started. StartReceiver flag is set to false", filterName));
              }
          }
  </code></pre>
  
  <p>First thing that came to my mind is to use MOQ and verify that SetupFilter method was called at least once but the compiler complained on the method being static.
  Any idea on how to write a test for this method? How do I set it up using VS-unit testing framework and what do I need to Assert?</p>