public void PlayerPrefLocaleSelector_WhenLocaleIsChanged_RecordsLocaleToPlayerPrefs()
        {
            var spanish = m_TestSettings.GetAvailableLocales().GetLocale(SystemLanguage.Spanish);

            Assert.NotNull(spanish);
            Assert.AreNotEqual(m_TestSettings.GetSelectedLocale(), spanish);

            m_TestSettings.SetSelectedLocale(spanish);

            Assert.IsTrue(PlayerPrefs.HasKey(k_PlayerPrefKey), "Expected Player Pref Key to be set when the selected locale was changed.");

            var pref = PlayerPrefs.GetString(k_PlayerPrefKey);

            Assert.AreEqual(spanish.Identifier.Code, pref, "Expected the player prefs to contain the selected locale");
        }
Beispiel #2
0
 public void NullAvailableLocalesProducesError()
 {
     m_Settings.SetAvailableLocales(null);
     Assert.IsNull(m_Settings.GetSelectedLocale(), "Expected no locale to be returned.");
     LogAssert.Expect(LogType.Error, "AvailableLocales is null, can not pick a Locale.");
 }