From cc694bf15baaceff542059afb2ba403984cc6d94 Mon Sep 17 00:00:00 2001 From: Sipke Schoorstra Date: Tue, 14 Jan 2025 23:19:51 +0100 Subject: [PATCH] Use `var` for local variables in test cases Updated all instances of explicitly typed `string` and `JsonElement` to `var` in `JsonElementConverterTests.cs` to improve code readability and maintain consistency with modern C# coding practices. This change does not affect functionality but aligns with better style conventions. --- .../JsonElementConverterTests.cs | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/test/integration/Elsa.JavaScript.IntegrationTests/JsonElementConverterTests.cs b/test/integration/Elsa.JavaScript.IntegrationTests/JsonElementConverterTests.cs index f48eb58c6..b7203e554 100644 --- a/test/integration/Elsa.JavaScript.IntegrationTests/JsonElementConverterTests.cs +++ b/test/integration/Elsa.JavaScript.IntegrationTests/JsonElementConverterTests.cs @@ -23,8 +23,8 @@ public class JsonElementConverterTests(ITestOutputHelper testOutputHelper) Name = "JsonVariable" }; - string jsonString = "{\"name\": \"John\", \"age\": 30}"; - JsonElement jsonElement = JsonSerializer.Deserialize(jsonString); + var jsonString = "{\"name\": \"John\", \"age\": 30}"; + var jsonElement = JsonSerializer.Deserialize(jsonString); jsonVariable.Set(expressionExecutionContext, jsonElement); var script = "getVariable('JsonVariable').age"; @@ -42,8 +42,8 @@ public class JsonElementConverterTests(ITestOutputHelper testOutputHelper) Name = "JsonVariable" }; - string jsonString = "[1, 2, 3, 4, 5, 6]"; - JsonElement jsonElement = JsonSerializer.Deserialize(jsonString); + var jsonString = "[1, 2, 3, 4, 5, 6]"; + var jsonElement = JsonSerializer.Deserialize(jsonString); jsonVariable.Set(expressionExecutionContext, jsonElement); var script = "getVariable('JsonVariable')[3]"; @@ -61,8 +61,8 @@ public class JsonElementConverterTests(ITestOutputHelper testOutputHelper) Name = "JsonVariable" }; - string jsonString = "\"I'm just a string\""; - JsonElement jsonElement = JsonSerializer.Deserialize(jsonString); + var jsonString = "\"I'm just a string\""; + var jsonElement = JsonSerializer.Deserialize(jsonString); jsonVariable.Set(expressionExecutionContext, jsonElement); var script = "getVariable('JsonVariable')"; @@ -80,8 +80,8 @@ public class JsonElementConverterTests(ITestOutputHelper testOutputHelper) Name = "JsonVariable" }; - string jsonString = "false"; - JsonElement jsonElement = JsonSerializer.Deserialize(jsonString); + var jsonString = "false"; + var jsonElement = JsonSerializer.Deserialize(jsonString); jsonVariable.Set(expressionExecutionContext, jsonElement); var script = "getVariable('JsonVariable')"; @@ -99,7 +99,7 @@ public class JsonElementConverterTests(ITestOutputHelper testOutputHelper) Name = "JsonVariable" }; - string jsonString = @" + var jsonString = @" { ""name"": ""John Doe"", ""age"": 35, @@ -128,7 +128,7 @@ public class JsonElementConverterTests(ITestOutputHelper testOutputHelper) ""isEmployed"": true, ""contact"": { ""email"": ""john.doe@example.com"", ""phone"": ""555-1234"" } }"; - JsonElement jsonElement = JsonSerializer.Deserialize(jsonString); + var jsonElement = JsonSerializer.Deserialize(jsonString); jsonVariable.Set(expressionExecutionContext, jsonElement);