I would like to get some unit test coverage on the following code:
public static class ExceptionExtensions {
   public static IEnumerable<Exception> SelfAndAllInnerExceptions(
      this Exception e) {
      yield return e;
      while (e.InnerException != null) {
         e = e.InnerException; //5
         yield return e; //6
      }
   }
}
Edit: it appears I did not need Moles to test this code. Also, I had a bug with lines 5 and 6 reversed.