Ejemplo n.º 1
0
    public void PlayerPrefsSetLesson_LessonAdded()
    {
        PlayerPrefsWithAds.SetPlayerPrefsForLessonWithId("lesson1", DateTime.Now);
        bool result = PlayerPrefsWithAds.CheckPlayerPrefsForLessonWithId("lesson1");

        Assert.AreEqual(true, result);
    }
Ejemplo n.º 2
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);
        }
    }
Ejemplo n.º 3
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);
        }
    }
Ejemplo n.º 4
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));
            }
        }
    }
Ejemplo n.º 5
0
    public void PlayerPrefsSetLesson_NoLesson()
    {
        bool result = PlayerPrefsWithAds.CheckPlayerPrefsForLessonWithId("lesson5");

        Assert.AreEqual(false, result);
    }