public void LongCreateFromeTimeSpan() { // Arrange var factory = new LongTimestampFactory(); // Act var zero = factory.Create(TimeSpan.Zero); // Assert Assert.Equal(0, zero); }
public void TimeLong() { // Arrange var factory = new LongTimestampFactory(); // Act var zero = factory.ToTimeSpan(0); // Assert Assert.Equal(TimeSpan.Zero, zero); }
public void CreateLong(DateTimeKind kind) { // Arrange var factory = new LongTimestampFactory(); var z = new DateTime(2001, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc); // 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); }
public void ZeroLong(DateTimeKind kind) { // Arrange var factory = new LongTimestampFactory(); var z = new DateTime(2001, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc); // Act var zero = factory.GetZero(kind); if (z.Kind != kind) { z = z.ToLocalTime(); } if (kind == DateTimeKind.Unspecified) { z = DateTime.SpecifyKind(z, DateTimeKind.Unspecified); } // Assert Assert.Equal(kind, zero.Kind); Assert.Equal(z, zero); }