diff --git a/.idea/.idea.SGuard/.idea/workspace.xml b/.idea/.idea.SGuard/.idea/workspace.xml
index a4500f4..485c304 100644
--- a/.idea/.idea.SGuard/.idea/workspace.xml
+++ b/.idea/.idea.SGuard/.idea/workspace.xml
@@ -6,10 +6,34 @@
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -19,6 +43,10 @@
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
@@ -105,7 +118,10 @@
-
+
+
+
+
@@ -126,19 +142,31 @@
-
+
-
-
@@ -223,6 +249,7 @@
+
@@ -425,17 +452,30 @@
file://$PROJECT_DIR$/tests/IsNullOrEmptyTests.cs
- 82
+ 83
-
+
-
+
+
+ file://$PROJECT_DIR$/tests/IsAllTests.cs
+ 55
+
+
+
+
+
+
+
+
+
+
diff --git a/SGuard.sln.DotSettings.user b/SGuard.sln.DotSettings.user
index 754f1b0..0fe46c3 100644
--- a/SGuard.sln.DotSettings.user
+++ b/SGuard.sln.DotSettings.user
@@ -3,7 +3,9 @@
ForceIncluded
ForceIncluded
ForceIncluded
+ ForceIncluded
ForceIncluded
+ ForceIncluded
ForceIncluded
ForceIncluded
ForceIncluded
@@ -15,17 +17,24 @@
ForceIncluded
ForceIncluded
ForceIncluded
- /Users/selcuk/Library/Caches/JetBrains/Rider2025.2/resharper-host/temp/Rider/vAny/CoverageData/_SGuard.-762714354/Snapshot/snapshot.utdcvr
+
<SessionState ContinuousTestingMode="0" Name="All tests from <tests>\<SGuard.Tests>" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session">
<Solution />
</SessionState>
- <SessionState ContinuousTestingMode="0" IsActive="True" Name="All tests from <tests>\<SGuard.Tests>" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session">
+ <SessionState ContinuousTestingMode="0" IsActive="True" Name="All tests from <tests>" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session">
+ <Project Location="/home/selcuk/RiderProjects/SGuard" Presentation="<tests>" />
+</SessionState>
+
+ <SessionState ContinuousTestingMode="0" Name="All_ReturnsTrue_ForEmptySource" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session">
+ <Project Location="/home/selcuk/RiderProjects/SGuard/tests" Presentation="<tests>\<SGuard.Tests>" />
+</SessionState>
+ <SessionState ContinuousTestingMode="0" Name="All tests from <tests>\<SGuard.Tests>" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session">
<Project Location="C:\Users\selcuk.gural\Documents\GitHub\sguard\tests" Presentation="<tests>\<SGuard.Tests>" />
</SessionState>
- <SessionState ContinuousTestingMode="0" IsActive="True" Name="NullOrEmptyVisitorOptimizedTests" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session">
+ <SessionState ContinuousTestingMode="0" Name="NullOrEmptyVisitorOptimizedTests" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session">
<Project Location="/Users/selcuk/RiderProjects/sguard/tests" Presentation="<tests>\<SGuard.Tests>" />
</SessionState>
- <SessionState ContinuousTestingMode="0" IsActive="True" Name="All tests from <tests>\<SGuard.Tests>" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session">
+ <SessionState ContinuousTestingMode="0" Name="All tests from <tests>\<SGuard.Tests>" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session">
<Project Location="/Users/selcuk/RiderProjects/sguard/tests" Presentation="<tests>\<SGuard.Tests>" />
</SessionState>
\ No newline at end of file
diff --git a/guard/SGuard.csproj b/guard/SGuard.csproj
index 31f0f08..bf8a563 100644
--- a/guard/SGuard.csproj
+++ b/guard/SGuard.csproj
@@ -14,7 +14,7 @@
guard;is;throwIf;sguard;validation;dotnet;csharp;callbacks
SGuard is a lightweight guard library for .NET that offers explicit boolean checks (Is.*) and throwing guards (ThrowIf.*), a unified GuardCallback/GuardOutcome model, and richly-informative exceptions via CallerArgumentExpression for easier diagnostics. Targets net6.0/net7.0/net8.0/net9.0.
- net6.0;net7.0;net8.0;net9.0
+ net8.0;net9.0;net10.0
SGuard
Selçuk Güral
Selçuk Güral
diff --git a/guard/SGuard.csproj.DotSettings b/guard/SGuard.csproj.DotSettings
index cd60914..9928d7a 100644
--- a/guard/SGuard.csproj.DotSettings
+++ b/guard/SGuard.csproj.DotSettings
@@ -5,6 +5,7 @@
True
True
True
+ True
True
True
True
diff --git a/guard/src/Callbacks/SGuardCallback.cs b/guard/src/Callbacks/SGuardCallback.cs
index 484efce..428277d 100644
--- a/guard/src/Callbacks/SGuardCallback.cs
+++ b/guard/src/Callbacks/SGuardCallback.cs
@@ -24,11 +24,23 @@ public static class SGuardCallbacks
/// Invokes the action only when an outcome is Success.
///
public static SGuardCallback OnSuccess(Action action)
- => outcome => { if (outcome == GuardOutcome.Success) action(); };
+ => outcome =>
+ {
+ if (outcome == GuardOutcome.Success)
+ {
+ action();
+ }
+ };
///
/// Invokes the action only when an outcome is Failure.
///
public static SGuardCallback OnFailure(Action action)
- => outcome => { if (outcome == GuardOutcome.Failure) action(); };
+ => outcome =>
+ {
+ if (outcome == GuardOutcome.Failure)
+ {
+ action();
+ }
+ };
}
\ No newline at end of file
diff --git a/guard/src/Common/ExceptionActivator.cs b/guard/src/Common/ExceptionActivator.cs
index df3f3a6..2ac8850 100644
--- a/guard/src/Common/ExceptionActivator.cs
+++ b/guard/src/Common/ExceptionActivator.cs
@@ -31,7 +31,7 @@ public static TException Create(object?[]? args) where TException :
{
try
{
- return (TException?)Activator.CreateInstance(typeof(TException), args ?? Array.Empty