コード例 #1
0
        public void GivenForDouble_WhenGet_ThenDoubleRetrieved()
        {
            var expected = 123;

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

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

            Assert.That(actual, Is.EqualTo(expected));
        }
コード例 #2
0
        public void GivenForDouble_WhenSet_ThenDoubleStoredAsString()
        {
            var expected = 22;

            PlayerPrefs.SetString(TestKey, "55");

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

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

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