public void SerializationSetsCorrectDateTime(EmergencyAccess emergencyAccess) { var token = new EmergencyAccessInviteTokenable(emergencyAccess, 2); Assert.Equal(Tokenable.FromToken <EmergencyAccessInviteTokenable>(token.ToToken().ToString()).ExpirationDate, token.ExpirationDate, TimeSpan.FromMilliseconds(10)); }
public void SerializationSetsCorrectDateTime(User user) { var expectedDateTime = DateTime.UtcNow.AddHours(-5); var token = new HCaptchaTokenable(user) { ExpirationDate = expectedDateTime }; var result = Tokenable.FromToken <HCaptchaTokenable>(token.ToToken()); Assert.Equal(expectedDateTime, result.ExpirationDate, TimeSpan.FromMilliseconds(10)); }