예제 #1
0
    public void PlayerPrefsSetLesson_CheckLessonAddedRecent()
    {
        PlayerPrefsWithAds.SetPlayerPrefsForLessonWithId("lesson2", DateTime.Now);
        bool result = PlayerPrefsWithAds.CheckPlayerPrefsForLessonWithId("lesson2");

        if (result == true)
        {
            bool checkTime = PlayerPrefsWithAds.CheckDateTimeForLessonWithId("lesson2");
            Assert.AreEqual(true, checkTime);
        }
    }
예제 #2
0
    public void PlayerPrefsSetLesson_CheckLessonAddedOld()
    {
        DateTime old = DateTime.Now.AddHours(-3);

        PlayerPrefsWithAds.SetPlayerPrefsForLessonWithId("lesson3", old);
        bool result = PlayerPrefsWithAds.CheckPlayerPrefsForLessonWithId("lesson3");

        if (result == true)
        {
            bool checkTime = PlayerPrefsWithAds.CheckDateTimeForLessonWithId("lesson3");
            Assert.AreEqual(false, checkTime);
        }
    }
예제 #3
0
    public void PlayerPrefsSetLesson_CheckOldRemoval()
    {
        DateTime old = DateTime.Now.AddHours(-3);

        PlayerPrefsWithAds.SetPlayerPrefsForLessonWithId("lesson10", old);
        bool result = PlayerPrefsWithAds.CheckPlayerPrefsForLessonWithId("lesson10");

        if (result == true)
        {
            bool checkTime = PlayerPrefsWithAds.CheckDateTimeForLessonWithId("lesson10");
            if (checkTime == false)
            {
                string data = PlayerPrefs.GetString("lesson10", null);
                Assert.AreEqual(true, string.IsNullOrEmpty(data));
            }
        }
    }