-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'personal/linux-fixes' into ci-dev
- Loading branch information
Showing
19 changed files
with
183 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// Copyright (c) 2022, salesforce.com, inc. | ||
// All rights reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/Apache-2.0 | ||
|
||
namespace Sage.Engine.Tests.Functions | ||
{ | ||
internal class DataTests : FunctionTestBase | ||
{ | ||
[Test] | ||
public void Lookup() | ||
{ | ||
var emailAddress = this._runtimeContext.LOOKUP("Loyalty","EmailAddress","SubscriberKey", "1"); | ||
Assert.That(emailAddress, Is.EqualTo("[email protected]")); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// Copyright (c) 2022, salesforce.com, inc. | ||
// All rights reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/Apache-2.0 | ||
|
||
namespace Sage.Engine.Tests.Functions | ||
{ | ||
internal class DateTimeTests : FunctionTestBase | ||
{ | ||
[Test] | ||
[TestCase("2023-05-01 5:00:00", "5/1/2023 5:00:00 AM")] | ||
public void TestDateTimeParse(string input, string expected) | ||
{ | ||
string actual = this._runtimeContext.V(this._runtimeContext.DATEPARSE(input)); | ||
Assert.That(actual, Is.EqualTo(expected)); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
src/Sage.Engine/Globalization/CompatibleGlobalizationSettings.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// Copyright (c) 2022, salesforce.com, inc. | ||
// All rights reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/Apache-2.0 | ||
|
||
using System.Globalization; | ||
|
||
namespace Sage.Engine.Runtime | ||
{ | ||
public static class CompatibleGlobalizationSettings | ||
{ | ||
/// <summary> | ||
/// There will be many differences between linux, mac, windows for globalization settings. | ||
/// Example, see: https://github.com/dotnet/runtime/issues/18345 | ||
/// In that issue, there is no desire to support common settings between different OSs. | ||
/// In order to maintain compatibility with existing code, the culture infos are hardcoded. | ||
/// For now, just support en-US. In the future, a more robust test stratgy and validation needs created. | ||
/// </summary> | ||
public static CultureInfo GetCulture(string culture) | ||
{ | ||
CultureInfo returnCulture = (CultureInfo)(new CultureInfo(culture, false)).Clone(); | ||
|
||
if (culture.ToLower() == "en-us") | ||
{ | ||
returnCulture.DateTimeFormat.ShortDatePattern = "M/d/yyyy"; | ||
} | ||
|
||
return returnCulture; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.