You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
746 B
C#

5 years ago
using System;
using DateTimeStudy;
using Xunit;
namespace DateTimeStudyTest
{
public class DateTimeOffsetStudyTest
{
[Fact]
public void CreateDateTimeOffsetTest()
{
var offsetTime = DateTimeOffsetStudy.CreateDateTimeOffset();
var currentDateTime = DateTime.Now;
Assert.Equal(offsetTime.Date,currentDateTime.Date);
var offsetTimespan = offsetTime.Offset;
Assert.Equal(8,offsetTimespan.Hours);
TimeZoneInfo palmer = TimeZoneInfo.CreateCustomTimeZone("1", offsetTimespan, "DisplayName", "UTC8", "", new TimeZoneInfo.AdjustmentRule[]{});
Assert.Equal(DateTimeKind.Unspecified, offsetTime.Date.Kind);
}
}
}