public void ToLdapDateTimeShould_ReturnExpectedResult() { // Arrange var expected = "20151015103200.0Z"; var date = new DateTime(2015, 10, 15, 10, 32, 00); // Act var actual = AdDateTime.ToLdapDateTime(date); // Assert Assert.Equal(expected, actual); }
public void ToDateTime_Should_ReturnMaxDate_When_ProvidedWithLargeIntegerThatIsAllOnes() { // Arrange var expected = DateTime.MaxValue; var date = new LargeInteger() { HighPart = 2147483647, LowPart = -1 }; // Act var actual = AdDateTime.ToDateTime(date); // Assert Assert.Equal(expected.ToString("s"), actual.ToString("s")); }
public void ToDateTime_Should_ReturnExpectedResult() { // Arrange var expected = new DateTime(2015, 10, 15, 10, 32, 00, DateTimeKind.Utc); var date = new LargeInteger() { HighPart = 30476084, LowPart = -1185116160 }; // Act var actual = AdDateTime.ToDateTime(date); // Assert Assert.Equal(expected.ToString("s"), actual.ToString("s")); }