Beispiel #1
0
        public void LongCreateFromeTimeSpan()
        {
            // Arrange
            var factory = new LongTimestampFactory();

            // Act
            var zero = factory.Create(TimeSpan.Zero);

            // Assert
            Assert.Equal(0, zero);
        }
Beispiel #2
0
        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);
        }