namespace Spectre.Console.Tests.Data; public static class TestExceptions { public static bool MethodThatThrows(int? number) => throw new InvalidOperationException("Throwing!"); public static bool GenericMethodThatThrows(int? number) => throw new InvalidOperationException("Throwing!"); public static void ThrowWithInnerException() { try { MethodThatThrows(null); } catch (Exception ex) { throw new InvalidOperationException("Something threw!", ex); } } public static void ThrowWithGenericInnerException() { try { GenericMethodThatThrows(null); } catch (Exception ex) { throw new InvalidOperationException("Something threw!", ex); } } public static List GenericMethodWithOutThatThrows(out List firstFewItems) { firstFewItems = new List(); throw new InvalidOperationException("Throwing!"); } public static (string Key, List Values) GetTuplesWithInnerException((int First, string Second) myValue) { MethodThatThrows(0); return ("key", new List()); } }