public void UnixLongCreateFromeTimeSpan() { // Arrange var factory = new UnixLongTimestampFactory(); // Act var zero = factory.Create(TimeSpan.Zero); // Assert Assert.Equal(0, zero); }
public void CreateUnixLong(DateTimeKind kind) { // Arrange var factory = new UnixLongTimestampFactory(); var z = DateTime.UnixEpoch.ToUniversalTime(); // Act if (kind != DateTimeKind.Utc) { z = z.ToLocalTime(); } if (kind == DateTimeKind.Unspecified) { z = DateTime.SpecifyKind(z, DateTimeKind.Unspecified); } var zero = factory.Create(z); // Assert Assert.Equal(0, zero); }