示例#1
0
        public void LicenseExpirationCheck_LicenseExpiries_ExpectedProgressHasReset(LicenseLevels expectedLevel)
        {
            bool currentProgress  = true;
            bool expectedProgress = false;

            WordLeo word = CreateWordLeo(expectedLevel, currentProgress);

            word.progress.lastRepeat = DateTime.Now - new TimeSpan(0, LicenseTimeTraining.Level_9 + 1, 0);
            word.LicenseExpirationCheck();

            Assert.AreEqual(word.progress.word_translate, expectedProgress);
            Assert.AreEqual(word.progress.translate_word, expectedProgress);
            Assert.AreEqual(word.progress.audio_word, expectedProgress);
            Assert.AreEqual(word.progress.word_puzzle, expectedProgress);
        }
示例#2
0
    public void Init(WordLeo word)
    {
        wordImage.sprite         = Utilities.GetSprite(word.pictureURL);
        wordImage.preserveAspect = true;

        levelText.text = word.progress.license.ToString();
        wordText.text  = word.wordValue + " - " + word.translations;
        word.LicenseExpirationCheck();

        TimeSpan time = word.GetLicenseValidityTime();

        TimeReduceText.text = Utilities.FormatTime(time);

        TimeSpan timeUnlock = word.GetLicenseUnlockForRepeat();

        TimeUnlockText.text = Utilities.FormatTime(timeUnlock);

        GetComponent <Transform>().localScale    = Vector3.one;
        GetComponent <Transform>().localPosition = Vector3.zero;
    }