title: Unit Test & try catch for method returning a list of objects c#
body: <p>I have the following method in my WCF service. I need to do a unit test for it, but am unsure how to do this since it returns a list of objects Mountain.</p>
  
  <p>The method takes in a grid reference e.g. NN - and searches the list mountslist for those mountains with grid reference starting with NN.</p>
  
  <p>Also can anyone help me as to how I can do a try catch for this? I am confused as to what to return since it expects a Mountain object. (If not found return - mountain not in list for example).</p>
  
  <pre><code>public IEnumerable&lt;Mountain&gt; GetMountainLoc(string mtloc)
  {    
    IEnumerable&lt;Mountain&gt; resultMts = 
         mountsList
         .Where(x =&gt; x.Grid_ref.Substring(0, 2) == mtloc)
         .ToList();
    return resultMts;    
  }
  </code></pre>