diff --git a/src/Sage.Engine.Data/Sqlite/ParameterizedQueryItem.cs b/src/Sage.Engine.Data/Sqlite/ParameterizedQueryItem.cs index c6382f5..e656ef3 100644 --- a/src/Sage.Engine.Data/Sqlite/ParameterizedQueryItem.cs +++ b/src/Sage.Engine.Data/Sqlite/ParameterizedQueryItem.cs @@ -46,7 +46,7 @@ public bool CaseSensitive public ParameterizedQueryItem(string parameterName, string data, bool caseSensitive) { QuotedIdentifier = QuotedIdentifier.Create(parameterName); - ParameterizedName = $"${QuotedIdentifier.Unquote()}"; + ParameterizedName = $"${QuotedIdentifier.Unquote().Replace(' ', '_')}"; CaseSensitive = caseSensitive; Data = data; } diff --git a/src/Sage.Engine.Tests/DataExtensions/LOYALTY.csv b/src/Sage.Engine.Tests/DataExtensions/LOYALTY.csv index e792c98..eaaa132 100644 --- a/src/Sage.Engine.Tests/DataExtensions/LOYALTY.csv +++ b/src/Sage.Engine.Tests/DataExtensions/LOYALTY.csv @@ -1,4 +1,4 @@ -EmailAddress,SubscriberKey,FirstName,LastName,LoyaltyLevel +EmailAddress,SubscriberKey,First Name,LastName,LoyaltyLevel donnie@northerntrailoutfitters.com,1,Donnie,Stanton,Silver wilburn@northerntrailoutfitters.com,2,Wilburn,McMillan,Gold aubrey@northerntrailoutfitters.com,3,Aubrey,Kirby,Gold diff --git a/src/Sage.Engine.Tests/Functions/DataTests.cs b/src/Sage.Engine.Tests/Functions/DataTests.cs index 6d5f6e5..4f44a9b 100644 --- a/src/Sage.Engine.Tests/Functions/DataTests.cs +++ b/src/Sage.Engine.Tests/Functions/DataTests.cs @@ -10,7 +10,14 @@ internal class DataTests : FunctionTestBase [Test] public void Lookup() { - var emailAddress = this._runtimeContext.LOOKUP("Loyalty","EmailAddress","SubscriberKey", "1"); + var emailAddress = this._runtimeContext.LOOKUP("Loyalty", "EmailAddress", "SubscriberKey", "1"); + Assert.That(emailAddress, Is.EqualTo("donnie@northerntrailoutfitters.com")); + } + + [Test] + public void LookupWithSpaceHeader() + { + var emailAddress = this._runtimeContext.LOOKUP("Loyalty", "EmailAddress", "First Name", "donnie"); Assert.That(emailAddress, Is.EqualTo("donnie@northerntrailoutfitters.com")); } }