diff --git a/DragonFruit.Common.Data.Tests/RequestDataCompilationTests.cs b/DragonFruit.Common.Data.Tests/RequestDataCompilationTests.cs index 820904a..619c374 100644 --- a/DragonFruit.Common.Data.Tests/RequestDataCompilationTests.cs +++ b/DragonFruit.Common.Data.Tests/RequestDataCompilationTests.cs @@ -3,6 +3,7 @@ using System.Linq; using DragonFruit.Common.Data.Parameters; +using DragonFruit.Common.Data.Utils; using NUnit.Framework; namespace DragonFruit.Common.Data.Tests @@ -29,10 +30,11 @@ public void TestQueries() [TestCase] public void TestEnumHandling() { - var query = new TestRequest().FullUrl.Split('?').Last().Split('&'); + var request = new TestRequest(); + var query = request.FullUrl.Split('?').Last().Split('&'); Assert.IsTrue(query.Contains($"enum={nameof(EnumValues.Red)}")); - Assert.IsTrue(query.Contains($"enum={nameof(EnumValues.Blue).ToLower()}")); + Assert.IsTrue(query.Contains($"enum={nameof(EnumValues.Blue).ToLower(CultureUtils.DefaultCulture)}")); Assert.IsTrue(query.Contains($"enum={(int)EnumValues.Green}")); } } diff --git a/DragonFruit.Common.Data/Utils/ParameterUtils.cs b/DragonFruit.Common.Data/Utils/ParameterUtils.cs index 6a9993e..919322b 100644 --- a/DragonFruit.Common.Data/Utils/ParameterUtils.cs +++ b/DragonFruit.Common.Data/Utils/ParameterUtils.cs @@ -65,7 +65,7 @@ internal static IEnumerable> GetParameter(object yield return attribute.EnumHandling.Value switch { EnumHandlingMode.Numeric => ((int)propertyValue).ToKeyValuePair(keyName, culture), - EnumHandlingMode.StringLower => propertyValue.ToString().ToLower().ToKeyValuePair(keyName, culture), + EnumHandlingMode.StringLower => propertyValue.ToString().ToLower(culture).ToKeyValuePair(keyName, culture), // default includes string handling _ => propertyValue.ToKeyValuePair(keyName, culture)