title: How to unit test when Microsoft.Azure.ServiceBus.Core.MessageReceiver is involved
body: <p>I'm trying to unit test an Azure Function which has a dependency with MessageReceiver class.
  The class definition looks like:</p>
  <pre><code>public class MessageReceiver : ClientEntity, IMessageReceiver, IReceiverClient, IClientEntity
  </code></pre>
  <p>And the methods that I need to moq belong to the interface IMessageReceiver</p>
  <p>I tried Mocking the class MessageReceiver, and Setup the method CompleteAsync but I got the error:</p>
  <pre><code>Non-overridable members (here: MessageReceiver.CompleteAsync) may not be used in setup / verification expressions.
  </code></pre>
  <p>Which afaik means that methods that are not virtual, abstract, or override can not be overriden/moq.
  I tried manually creating a child class and declaring a method CompleteAsync with the new keywork in the definition,</p>
  <pre><code>public new Task CompleteAsync(string lockToken)
  </code></pre>
  <p>in this case the code throws an error at the point where the CompleteAsync method is called:</p>
  <pre><code>Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).
  </code></pre>
  <p>But I don't think it can work, since I tried pressing F11 to enter the method, and my method was not called...
  Any ideas or sugestions?</p>