diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2015-11-08 10:18:21 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2015-11-08 10:18:21 +0700 |
commit | fa43cd3f5404ec4a85366a9364e390a68a112b78 (patch) | |
tree | a96b2565c668d8de2be880b8623ac815515dfaa2 /crypto/test/src/util | |
parent | Missed a Close/Dispose change (diff) | |
download | BouncyCastle.NET-ed25519-fa43cd3f5404ec4a85366a9364e390a68a112b78.tar.xz |
DateTime portability changes for tests under PORTABLE
Diffstat (limited to 'crypto/test/src/util')
-rw-r--r-- | crypto/test/src/util/test/SimpleTest.cs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/crypto/test/src/util/test/SimpleTest.cs b/crypto/test/src/util/test/SimpleTest.cs index be846e20f..84a7ce02b 100644 --- a/crypto/test/src/util/test/SimpleTest.cs +++ b/crypto/test/src/util/test/SimpleTest.cs @@ -160,5 +160,23 @@ namespace Org.BouncyCastle.Utilities.Test internal static readonly string NewLine = GetNewLine(); public abstract void PerformTest(); + + public static DateTime MakeUtcDateTime(int year, int month, int day, int hour, int minute, int second) + { +#if PORTABLE + return new DateTime(year, month, day, hour, minute, second, DateTimeKind.Utc); +#else + return new DateTime(year, month, day, hour, minute, second); +#endif + } + + public static DateTime MakeUtcDateTime(int year, int month, int day, int hour, int minute, int second, int millisecond) + { +#if PORTABLE + return new DateTime(year, month, day, hour, minute, second, millisecond, DateTimeKind.Utc); +#else + return new DateTime(year, month, day, hour, minute, second, millisecond); +#endif + } } } |