public async Task FromException() { var toThrow = new BuildXLException("Got exception?"); try { await TaskUtilities.FromException <int>(toThrow); } catch (BuildXLException ex) { XAssert.AreSame(toThrow, ex); return; } XAssert.Fail("Expected an exception"); }