title: async await for virtual method
body: <p>In our old synchronous application, we had the following in our base class:</p>
  
  <pre><code>public virtual bool ShouldSomethingHappen() =&gt; false;
  </code></pre>
  
  <p>So, the idea is that in the derived class, a call can be made to the DB to determine if something should happen.</p>
  
  <p>So, when moving to awaited code, we first tried the following in the base class:</p>
  
  <pre><code>public virtual async Task&lt;bool&gt; ShouldSomethingHappen()
  {
      await Task.Yield();
      return false;
  }
  </code></pre>
  
  <p>This seemed to work fine when running the application, but it broke our integration tests (where we have many awaited calls)....we couldn't figure out why.</p>
  
  <p>But, changing this to the following fixed the issue:</p>
  
  <pre><code>public virtual async Task&lt;bool&gt; ShouldSomethingHappen() =&gt; Task.FromResult(false);
  </code></pre>
  
  <p>So technically, what's the difference between the two approaches?</p>