title: ExcludeFromCodeCoverage not working for CloseAsync method
body: <p>I know this question has been asked before too, but I couldn't find any solution for this problem.  </p>
  
  <p>I have a Microsoft Azure Event hubs processor, <code>ProcessorHost</code> which is implementing <code>IEventProcessor</code> interface.  </p>
  
  <p>It has methods <code>IEventProcessor.OpenAsync</code>, <code>IEventProcessor.CloseAsync</code> and few other custom methods in this class. For those custom methods I have written the test cases using MSTest and they have passed.  </p>
  
  <p>Now I have decorated <code>OpenAsync</code> and <code>CloseAsync</code> methods with <code>[ExcludeFromCodeCoverage]</code> like mentioned below.</p>
  
  <pre><code>[ExcludeFromCodeCoverage]
  async Task IEventProcessor.CloseAsync(PartitionContext context, CloseReason reason)
  {
  
  }
  
  [ExcludeFromCodeCoverage]
  Task IEventProcessor.OpenAsync(PartitionContext context)
  {
  
  }
  </code></pre>
  
  <p>I'm using Sonar-cube to test the code coverage. When I run the report to see the code coverage, it shows that <code>OpenAsync</code> method is covered, but <code>CloseAsync</code> method is not covered even after decorating with <code>[ExcludeFromCodeCoverage]</code>.   </p>
  
  <p>So I want to know is there anything else which has to be done for CloseAsync method to exclude it from code coverage.</p>
  
  <p><strong>EDIT :</strong>
  The complete method of closeAsync</p>
  
  <pre><code>async Task IEventProcessor.CloseAsync(PartitionContext context, CloseReason reason)
  {                
      if (reason == CloseReason.Shutdown)
      {
          await context.CheckpointAsync();
      }
  }
  </code></pre>