1
0

chore: adjust directory layout for new added planned peoject

This commit is contained in:
2026-01-18 11:07:52 +08:00
parent ab5a68bed7
commit 941e59e471
162 changed files with 251 additions and 229 deletions

View File

@@ -0,0 +1,28 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BallanceTasEditorTests {
public static class AssertExtension {
public static T ThrowsDerivedException<T>(Action action) where T : Exception {
try {
action();
} catch (T ex) {
return ex;
} catch (Exception ex) {
if (ex is T derivedEx)
return derivedEx;
throw new AssertFailedException(
$"Expected exception of type {typeof(T)} or derived type, but got {ex.GetType()}. " +
$"Message: {ex.Message}");
}
throw new AssertFailedException(
$"Expected exception of type {typeof(T)} or derived type, but no exception was thrown.");
}
}
}