mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-12-22 01:35:47 +08:00
Add global usings (#668)
* Use global usings * Fix namespace declarations for test projects
This commit is contained in:
@@ -1,35 +1,32 @@
|
||||
using System;
|
||||
namespace Spectre.Console.Tests.Data;
|
||||
|
||||
namespace Spectre.Console.Tests.Data
|
||||
public static class TestExceptions
|
||||
{
|
||||
public static class TestExceptions
|
||||
public static bool MethodThatThrows(int? number) => throw new InvalidOperationException("Throwing!");
|
||||
|
||||
public static bool GenericMethodThatThrows<T0, T1, TRet>(int? number) => throw new InvalidOperationException("Throwing!");
|
||||
|
||||
public static void ThrowWithInnerException()
|
||||
{
|
||||
public static bool MethodThatThrows(int? number) => throw new InvalidOperationException("Throwing!");
|
||||
|
||||
public static bool GenericMethodThatThrows<T0, T1, TRet>(int? number) => throw new InvalidOperationException("Throwing!");
|
||||
|
||||
public static void ThrowWithInnerException()
|
||||
try
|
||||
{
|
||||
try
|
||||
{
|
||||
MethodThatThrows(null);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new InvalidOperationException("Something threw!", ex);
|
||||
}
|
||||
MethodThatThrows(null);
|
||||
}
|
||||
|
||||
public static void ThrowWithGenericInnerException()
|
||||
catch (Exception ex)
|
||||
{
|
||||
try
|
||||
{
|
||||
GenericMethodThatThrows<int, float, double>(null);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new InvalidOperationException("Something threw!", ex);
|
||||
}
|
||||
throw new InvalidOperationException("Something threw!", ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void ThrowWithGenericInnerException()
|
||||
{
|
||||
try
|
||||
{
|
||||
GenericMethodThatThrows<int, float, double>(null);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new InvalidOperationException("Something threw!", ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user