8000 Hack some tests to make them Mono "compliant" · dotjosh/libgit2sharp@2ce3947 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2ce3947

Browse files
committed
Hack some tests to make them Mono "compliant"
Mono doesn't correctly parse a RFC1123 representation of a date into a DateTimeOffset yet.
1 parent 7218e1b commit 2ce3947

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

LibGit2Sharp.Tests/EpochFixture.cs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System;
2+
using System.Globalization;
23
using LibGit2Sharp.Core;
34
using NUnit.Framework;
45

@@ -38,9 +39,9 @@ public void AreEqual(long secondsSinceEpoch, int timezoneOffset)
3839
Assert.AreEqual(one.GetHashCode(), another.GetHashCode());
3940
}
4041

41-
[TestCase(1291801952, "Wed, 08 Dec 2010 09:52:32 GMT")]
42-
[TestCase(1234567890, "Fri, 13 Feb 2009 23:31:30 GMT")]
43-
[TestCase(1288114383, "Tue, 26 Oct 2010 17:33:03 GMT")]
42+
[TestCase(1291801952, "Wed, 08 Dec 2010 09:52:32 +0000")]
43+
[TestCase(1234567890, "Fri, 13 Feb 2009 23:31:30 +0000")]
44+
[TestCase(1288114383, "Tue, 26 Oct 2010 17:33:03 +0000")]
4445
public void UnixTimestampShouldShouldBeCastIntoAPlainUtcDate(long secondsSinceEpoch, string expected)
4546
{
4647
var expectedDate = DateTimeOffset.Parse(expected);
@@ -65,12 +66,12 @@ public void UnixTimestampAndTimezoneOffsetShouldBeCastIntoAUtcDateBearingAnOffse
6566
Assert.AreEqual(expectedDate.Offset, date.Offset);
6667
}
6768

68-
[TestCase("Wed, 08 Dec 2010 09:52:32 GMT", 1291801952, 0)]
69-
[TestCase("Fri, 13 Feb 2009 23:31:30 GMT", 1234567890, 0)]
70-
[TestCase("Tue, 26 Oct 2010 17:33:03 GMT", 1288114383, 0)]
69+
[TestCase("Wed, 08 Dec 2010 09:52:32 +0000", 1291801952, 0)]
70+
[TestCase("Fri, 13 Feb 2009 23:31:30 +0000", 1234567890, 0)]
71+
[TestCase("Tue, 26 Oct 2010 17:33:03 +0000", 1288114383, 0)]
7172
[TestCase("Sat, 14 Feb 2009 00:31:30 +0100", 1234567890, 60)]
7273
[TestCase("Sat, 15 Aug 2009 20:12:58 -0330", 1250379778, -210)]
73-
[TestCase("Sat, 15 Aug 2009 23:42:58 GMT", 1250379778, 0)]
74+
[TestCase("Sat, 15 Aug 2009 23:42:58 +0000", 1250379778, 0)]
7475
[TestCase("Sun, 16 Aug 2009 00:42:58 +0100", 1250379778, 60)]
7576
public void DateTimeOffsetShoudlBeCastIntoAUnixTimestampAndATimezoneOffset(string formattedDate, long expectedSeconds, Int32 expectedOffset)
7677
{

0 commit comments

Comments
 (0)
0