title: C# - Verify mocked (MoQ) property's method was called with part of string as a parameter
body: <p>I'm using MoQ and C# to mock a public property and I want to know if one of the mock's methods was called with any strings starting with a particular set of characters. </p>
  
  <p>So for example, while I know this works:</p>
  
  <pre><code>mockLogger.Verify(x =&gt; x.Information($"Entering {methodName}"), Times.Once);
  </code></pre>
  
  <p>I'm trying, with the below attempt, to see if <code>mockLogger</code>'s <code>Information()</code> method was called with a parameter starting with <code>$"Exception in {methodName} - Error Message: {ex.Message} - StackTrace:"</code></p>
  
  <pre><code>mockLogger.Verify(x =&gt; x.Information($"Exception in {methodName}: " +
                                           $"Error Message: {exceptionMessage} - " +
                                           $"StackTrace: ........"), Times.Once);
  </code></pre>
  
  <p>Is this not possible? Or is there some sort of workaround?</p>
  
  <p>EDIT:</p>
  
  <p>I've even tried</p>
  
  <pre><code>    mockLogger.Verify(x =&gt; x.Information($"Exception in {methodName}: " +
                                           $"Error Message: {exceptionMessage} - " +
                                           $"StackTrace: " + It.IsAny&lt;string&gt;()), 
                                           Times.Once);
  </code></pre>
  
  <p>but it doesn't seem to work either.</p>