Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2sharp.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornulltoken <emeric.fermas@gmail.com>2011-06-21 13:17:22 +0400
committernulltoken <emeric.fermas@gmail.com>2011-06-21 13:17:22 +0400
commit2ce39470f852c6ec834e9df548e6d0a5719e6b9a (patch)
tree03280a04b10fb0b98a616ffdebf4eda5fd675d8f
parent7218e1b6fa932c51028803aa1ff4359fcf44f44d (diff)
Hack some tests to make them Mono "compliant"
Mono doesn't correctly parse a RFC1123 representation of a date into a DateTimeOffset yet.
-rw-r--r--LibGit2Sharp.Tests/EpochFixture.cs15
1 files changed, 8 insertions, 7 deletions
diff --git a/LibGit2Sharp.Tests/EpochFixture.cs b/LibGit2Sharp.Tests/EpochFixture.cs
index 20fc59be..e82c97d6 100644
--- a/LibGit2Sharp.Tests/EpochFixture.cs
+++ b/LibGit2Sharp.Tests/EpochFixture.cs
@@ -1,4 +1,5 @@
using System;
+using System.Globalization;
using LibGit2Sharp.Core;
using NUnit.Framework;
@@ -38,9 +39,9 @@ namespace LibGit2Sharp.Tests
Assert.AreEqual(one.GetHashCode(), another.GetHashCode());
}
- [TestCase(1291801952, "Wed, 08 Dec 2010 09:52:32 GMT")]
- [TestCase(1234567890, "Fri, 13 Feb 2009 23:31:30 GMT")]
- [TestCase(1288114383, "Tue, 26 Oct 2010 17:33:03 GMT")]
+ [TestCase(1291801952, "Wed, 08 Dec 2010 09:52:32 +0000")]
+ [TestCase(1234567890, "Fri, 13 Feb 2009 23:31:30 +0000")]
+ [TestCase(1288114383, "Tue, 26 Oct 2010 17:33:03 +0000")]
public void UnixTimestampShouldShouldBeCastIntoAPlainUtcDate(long secondsSinceEpoch, string expected)
{
var expectedDate = DateTimeOffset.Parse(expected);
@@ -65,12 +66,12 @@ namespace LibGit2Sharp.Tests
Assert.AreEqual(expectedDate.Offset, date.Offset);
}
- [TestCase("Wed, 08 Dec 2010 09:52:32 GMT", 1291801952, 0)]
- [TestCase("Fri, 13 Feb 2009 23:31:30 GMT", 1234567890, 0)]
- [TestCase("Tue, 26 Oct 2010 17:33:03 GMT", 1288114383, 0)]
+ [TestCase("Wed, 08 Dec 2010 09:52:32 +0000", 1291801952, 0)]
+ [TestCase("Fri, 13 Feb 2009 23:31:30 +0000", 1234567890, 0)]
+ [TestCase("Tue, 26 Oct 2010 17:33:03 +0000", 1288114383, 0)]
[TestCase("Sat, 14 Feb 2009 00:31:30 +0100", 1234567890, 60)]
[TestCase("Sat, 15 Aug 2009 20:12:58 -0330", 1250379778, -210)]
- [TestCase("Sat, 15 Aug 2009 23:42:58 GMT", 1250379778, 0)]
+ [TestCase("Sat, 15 Aug 2009 23:42:58 +0000", 1250379778, 0)]
[TestCase("Sun, 16 Aug 2009 00:42:58 +0100", 1250379778, 60)]
public void DateTimeOffsetShoudlBeCastIntoAUnixTimestampAndATimezoneOffset(string formattedDate, long expectedSeconds, Int32 expectedOffset)
{