title: Reactive Extensions converting from IObservable to IEnumerable
body: <p>Given an Observable that will start pushing events once Subscribe is called. How can the sequence be converted into an IEnumerable.</p>
  
  <p>In 2010 Jon Skeet wrote about his first impressions of RX and wrote this, which would be equivalent to what I need.</p>
  
  <pre><code>public static List&lt;T&gt; ToList&lt;T&gt;(this IObservable&lt;T&gt; source) 
  { 
      List&lt;T&gt; ret = new List&lt;T&gt;(); 
      source.Subscribe(x =&gt; ret.Add(x)); 
      return ret; 
  }
  </code></pre>
  
  <p><a href="https://codeblog.jonskeet.uk/2010/01/16/first-encounters-with-reactive-extensions/" rel="nofollow noreferrer">https://codeblog.jonskeet.uk/2010/01/16/first-encounters-with-reactive-extensions/</a></p>
  
  <p>While this solution would work it seems like there should be a better way.</p>
  
  <p>What we're really interested in is the ability to <code>await</code> the observable in a way that behaves similarly to Subscribe. </p>
  
  <pre><code>await observable.ToList()
  </code></pre>
  
  <p>However, this doesn't seem to work for me.</p>
  
  <p>I've also looked into these two methods</p>
  
  <pre><code>observable.ToEnumerable
  observable.Next
  </code></pre>
  
  <p><em>A little more information</em></p>
  
  <p>I plan to use this to write some unit tests.</p>
  
  <ol>
  <li>I'm using a <code>ReplaySubject</code> and performing a sequence of actions with a test substitute.</li>
  <li>Calls to the substitute are recorded via <code>OnNext</code>.</li>
  <li>I can get the list of calls and Assert they are correct.</li>
  </ol>