diff --git a/GFramework.Core.Tests/Logging/DefaultLogFormatterTests.cs b/GFramework.Core.Tests/Logging/DefaultLogFormatterTests.cs index 7d363e98..9d607520 100644 --- a/GFramework.Core.Tests/Logging/DefaultLogFormatterTests.cs +++ b/GFramework.Core.Tests/Logging/DefaultLogFormatterTests.cs @@ -48,7 +48,7 @@ public class DefaultLogFormatterTests [Test] public void Format_WithProperties_ShouldIncludeProperties() { - var properties = new Dictionary + var properties = new Dictionary(StringComparer.Ordinal) { ["UserId"] = 12345, ["UserName"] = "TestUser" @@ -66,7 +66,7 @@ public class DefaultLogFormatterTests [Test] public void Format_WithNullProperty_ShouldHandleNull() { - var properties = new Dictionary + var properties = new Dictionary(StringComparer.Ordinal) { ["Key1"] = null }; @@ -114,4 +114,4 @@ public class DefaultLogFormatterTests Assert.That(result, Does.Contain(message)); } -} \ No newline at end of file +} diff --git a/GFramework.Core.Tests/Logging/JsonLogFormatterTests.cs b/GFramework.Core.Tests/Logging/JsonLogFormatterTests.cs index 3808770f..138b7dc3 100644 --- a/GFramework.Core.Tests/Logging/JsonLogFormatterTests.cs +++ b/GFramework.Core.Tests/Logging/JsonLogFormatterTests.cs @@ -54,7 +54,7 @@ public class JsonLogFormatterTests [Test] public void Format_WithProperties_ShouldIncludePropertiesObject() { - var properties = new Dictionary + var properties = new Dictionary(StringComparer.Ordinal) { ["UserId"] = 12345, ["UserName"] = "TestUser", @@ -93,7 +93,7 @@ public class JsonLogFormatterTests [Test] public void Format_WithNullProperty_ShouldHandleNull() { - var properties = new Dictionary + var properties = new Dictionary(StringComparer.Ordinal) { ["Key1"] = null, ["Key2"] = "value" @@ -170,7 +170,7 @@ public class JsonLogFormatterTests [Test] public void Format_WithComplexProperties_ShouldSerializeCorrectly() { - var properties = new Dictionary + var properties = new Dictionary(StringComparer.Ordinal) { ["Number"] = 123, ["String"] = "test", @@ -184,4 +184,4 @@ public class JsonLogFormatterTests Assert.That(() => JsonDocument.Parse(result), Throws.Nothing); } -} \ No newline at end of file +} diff --git a/GFramework.Core.Tests/Logging/LogEntryTests.cs b/GFramework.Core.Tests/Logging/LogEntryTests.cs index 76d8a0eb..bd7f2e9b 100644 --- a/GFramework.Core.Tests/Logging/LogEntryTests.cs +++ b/GFramework.Core.Tests/Logging/LogEntryTests.cs @@ -13,7 +13,7 @@ public class LogEntryTests public void Constructor_WithAllParameters_ShouldCreateEntry() { var timestamp = DateTime.UtcNow; - var properties = new Dictionary { ["Key1"] = "Value1" }; + var properties = new Dictionary(StringComparer.Ordinal) { ["Key1"] = "Value1" }; var exception = new InvalidOperationException("Test"); var entry = new LogEntry(timestamp, LogLevel.Info, "TestLogger", "Test message", exception, properties); @@ -63,7 +63,7 @@ public class LogEntryTests public void GetAllProperties_WithProperties_ShouldReturnOnlyProperties() { LogContext.Clear(); - var properties = new Dictionary { ["PropKey"] = "PropValue" }; + var properties = new Dictionary(StringComparer.Ordinal) { ["PropKey"] = "PropValue" }; var entry = new LogEntry(DateTime.UtcNow, LogLevel.Info, "TestLogger", "Test message", null, properties); var allProps = entry.GetAllProperties(); @@ -78,7 +78,7 @@ public class LogEntryTests LogContext.Clear(); using (LogContext.Push("ContextKey", "ContextValue")) { - var properties = new Dictionary { ["PropKey"] = "PropValue" }; + var properties = new Dictionary(StringComparer.Ordinal) { ["PropKey"] = "PropValue" }; var entry = new LogEntry(DateTime.UtcNow, LogLevel.Info, "TestLogger", "Test message", null, properties); var allProps = entry.GetAllProperties(); @@ -97,7 +97,7 @@ public class LogEntryTests LogContext.Clear(); using (LogContext.Push("Key1", "ContextValue")) { - var properties = new Dictionary { ["Key1"] = "PropValue" }; + var properties = new Dictionary(StringComparer.Ordinal) { ["Key1"] = "PropValue" }; var entry = new LogEntry(DateTime.UtcNow, LogLevel.Info, "TestLogger", "Test message", null, properties); var allProps = entry.GetAllProperties(); @@ -124,7 +124,7 @@ public class LogEntryTests public void RecordEquality_WithSameValues_ShouldBeEqual() { var timestamp = DateTime.UtcNow; - var properties = new Dictionary { ["Key1"] = "Value1" }; + var properties = new Dictionary(StringComparer.Ordinal) { ["Key1"] = "Value1" }; var entry1 = new LogEntry(timestamp, LogLevel.Info, "TestLogger", "Test message", null, properties); var entry2 = new LogEntry(timestamp, LogLevel.Info, "TestLogger", "Test message", null, properties); @@ -142,4 +142,4 @@ public class LogEntryTests Assert.That(entry1, Is.Not.EqualTo(entry2)); } -} \ No newline at end of file +}