Skip to content

Commit

Permalink
Merge pull request #24 from ekonbenefits/date-globalization-unittests
Browse files Browse the repository at this point in the history
fix test for non-us devs
  • Loading branch information
jbtule authored Apr 5, 2018
2 parents 4f91b3f + 43f926d commit cfad02a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
5 changes: 4 additions & 1 deletion .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@ configuration: Debug

build: off

install:
- ps: nuget install FSharp.Compiler.Tools -ExcludeVersion -OutputDirectory extra

build_script:
- cmd: set PATH=%PATH%;C:\Program Files (x86)\Microsoft SDKs\F#\4.1\Framework\v4.0\
- cmd: set PATH=%PATH%;%APPVEYOR_BUILD_FOLDER%\extra\FSharp.Compiler.Tools\tools\
- cmd: fsi --exec ./build.fsx

test: off
Expand Down
7 changes: 4 additions & 3 deletions Tests/Invoke.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
using Microsoft.CSharp.RuntimeBinder;
using Moq;
using NUnit.Framework;
using System.Globalization;

namespace Dynamitey.Tests
{
Expand Down Expand Up @@ -1079,7 +1080,7 @@ public void TestStaticDateTimeMethod()
{
var @static = InvokeContext.CreateStatic;
object tDateDyn = "01/20/2009";
var tDate = Dynamic.InvokeMember(@static(typeof(DateTime)), "Parse", tDateDyn);
var tDate = Dynamic.InvokeMember(@static(typeof(DateTime)), "Parse", tDateDyn, CultureInfo.GetCultureInfo("en-US"));
Assert.AreEqual(new DateTime(2009, 1, 20), tDate);
}

Expand All @@ -1088,9 +1089,9 @@ public void TestCacheableStaticDateTimeMethod()
{
var @static = InvokeContext.CreateStatic;
object tDateDyn = "01/20/2009";
var tCachedInvoke = new CacheableInvocation(InvocationKind.InvokeMember, "Parse", 1,
var tCachedInvoke = new CacheableInvocation(InvocationKind.InvokeMember, "Parse", 2,
context: @static(typeof(DateTime)));
var tDate = tCachedInvoke.Invoke(typeof(DateTime), tDateDyn);
var tDate = tCachedInvoke.Invoke(typeof(DateTime), tDateDyn,CultureInfo.GetCultureInfo("en-US"));
Assert.AreEqual(new DateTime(2009, 1, 20), tDate);
}

Expand Down

0 comments on commit cfad02a

Please sign in to comment.