diff --git a/Engine.Core/Debug/AssertHelpers.cs b/Engine.Core/Debug/AssertHelpers.cs index 6a2f9e5..4f0ea05 100644 --- a/Engine.Core/Debug/AssertHelpers.cs +++ b/Engine.Core/Debug/AssertHelpers.cs @@ -4,6 +4,22 @@ namespace Engine.Core.Debug; public static class Assert { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void AssertTrue(bool value, string errorMessage) + => System.Diagnostics.Debug.Assert(value, errorMessage); + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void AssertFalse(bool value, string errorMessage) + => System.Diagnostics.Debug.Assert(!value, errorMessage); + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void AssertNull(object? value, string errorMessage) + => System.Diagnostics.Debug.Assert(value is null, errorMessage); + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void AssertNotNull(object? value, string errorMessage) + => System.Diagnostics.Debug.Assert(value is not null, errorMessage); + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static void AssertInitialized(IInitializable initializable) => System.Diagnostics.Debug.Assert(initializable.IsInitialized, $"{initializable.GetType().Name} must be initialized");