2018-07-09 19:57:08 +01:00
|
|
|
|
using System;
|
|
|
|
|
|
using Claunia.PropertyList;
|
2017-03-16 23:37:42 +01:00
|
|
|
|
using Xunit;
|
2016-05-25 00:29:11 +02:00
|
|
|
|
|
2025-08-07 22:31:12 +01:00
|
|
|
|
namespace plistcil.test;
|
|
|
|
|
|
|
|
|
|
|
|
public class NSDateTests
|
2016-05-25 00:29:11 +02:00
|
|
|
|
{
|
2025-08-07 22:31:12 +01:00
|
|
|
|
[Fact]
|
|
|
|
|
|
public static void ConstructorTest()
|
2016-05-25 00:29:11 +02:00
|
|
|
|
{
|
2025-08-07 22:31:12 +01:00
|
|
|
|
var actual = new NSDate("2000-01-01T00:00:00Z");
|
|
|
|
|
|
var expected = new DateTime(2000, 1, 1, 0, 0, 0, DateTimeKind.Utc);
|
|
|
|
|
|
Assert.Equal(expected, actual.Date.ToUniversalTime());
|
|
|
|
|
|
}
|
2016-05-25 00:34:23 +02:00
|
|
|
|
|
2025-08-07 22:31:12 +01:00
|
|
|
|
[Fact]
|
|
|
|
|
|
public static void MakeDateStringTest()
|
|
|
|
|
|
{
|
|
|
|
|
|
var date = new DateTime(2000, 1, 1, 0, 0, 0, DateTimeKind.Utc);
|
|
|
|
|
|
string expected = "2000-01-01T00:00:00Z";
|
|
|
|
|
|
string actual = NSDate.MakeDateString(date);
|
2016-05-25 00:34:23 +02:00
|
|
|
|
|
2025-08-07 22:31:12 +01:00
|
|
|
|
Assert.Equal(expected, actual);
|
2016-05-25 00:29:11 +02:00
|
|
|
|
}
|
2018-07-09 19:57:08 +01:00
|
|
|
|
}
|