public void GivenForDateTime_WhenGet_ThenDateTimeRetrieved() { var expected = new DateTime(123456); PlayerPrefs.SetString(TestKey, expected.Ticks.ToString()); var actual = PowerPrefs.ForDateTime().Get(TestKey, new DateTime(10)); Assert.That(actual, Is.EqualTo(expected)); }
public void GivenForDateTime_WhenSet_ThenDateTimeStoredAsString() { var expected = new DateTime(11111); PlayerPrefs.SetString(TestKey, "55"); PowerPrefs.ForDateTime().Set(TestKey, expected); var actual = new DateTime(long.Parse(PlayerPrefs.GetString(TestKey, "-1"))); Assert.That(actual, Is.EqualTo(expected)); }