From 9ea3f49e0fbebd6483f02cb23a7da7d25a319b44 Mon Sep 17 00:00:00 2001 From: "lucas.hipolito" Date: Thu, 9 Oct 2025 09:41:27 +0200 Subject: [PATCH] Small improvement for generic Variable type evaluation --- .../Elsa.Activities.UnitTests/Helpers/ActivityTestHelper.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/unit/Elsa.Activities.UnitTests/Helpers/ActivityTestHelper.cs b/test/unit/Elsa.Activities.UnitTests/Helpers/ActivityTestHelper.cs index 1a2adedb4..d01f77a29 100644 --- a/test/unit/Elsa.Activities.UnitTests/Helpers/ActivityTestHelper.cs +++ b/test/unit/Elsa.Activities.UnitTests/Helpers/ActivityTestHelper.cs @@ -26,6 +26,7 @@ public static class ActivityTestHelper /// evaluating inputs, and executing the activity. /// /// The activity to execute + /// /// The ActivityExecutionContext used for execution public static async Task ExecuteActivityAsync(IActivity activity, Action? configureServices = null) { @@ -110,7 +111,7 @@ public static class ActivityTestHelper var activityType = activity.GetType(); var variableProperties = activityType.GetProperties() .Where(p => p.PropertyType.IsGenericType && - p.PropertyType.BaseType == typeof(Variable)) + p.PropertyType.GetGenericTypeDefinition() == typeof(Variable<>)) .ToList(); foreach (var variable in variableProperties.Select(property => (Variable)property.GetValue(activity)!))