示例#1
0
        public void GivenForLong_WhenGet_ThenLongRetrieved()
        {
            var expected = 123;

            PlayerPrefs.SetString(TestKey, expected.ToString());

            var actual = PowerPrefs.ForLong().Get(TestKey, -1);

            Assert.That(actual, Is.EqualTo(expected));
        }
示例#2
0
        public void GivenForLong_WhenSet_ThenLongStoredAsString()
        {
            var expected = 22;

            PlayerPrefs.SetString(TestKey, "55");

            PowerPrefs.ForLong().Set(TestKey, expected);

            var actual = long.Parse(PlayerPrefs.GetString(TestKey, "-1"));

            Assert.That(actual, Is.EqualTo(expected));
        }