public void Init()
        {
            m_OriginalSettings            = LocalizationSettings.Instance;
            m_TestSettings                = LocalizationSettingsHelper.CreateEmpty();
            LocalizationSettings.Instance = m_TestSettings;

            // Add the test locales
            var localeProvider = m_TestSettings.GetAvailableLocales();

            testLanguages.ForEach(o => localeProvider.AddLocale(Locale.CreateLocale(o)));

            PlayerPrefs.DeleteKey(k_PlayerPrefKey);
            m_PlayerPrefLocaleSelector = new PlayerPrefLocaleSelector {
                PlayerPreferenceKey = k_PlayerPrefKey
            };
            m_TestSettings.GetStartupLocaleSelectors().Add(m_PlayerPrefLocaleSelector);
        }
Ejemplo n.º 2
0
 public void EmptyStartupSelectorsProducesError()
 {
     m_Settings.GetStartupLocaleSelectors().Clear();
     Assert.IsNull(m_Settings.GetSelectedLocale(), "Expected no locale to be returned.");
     LogAssert.Expect(LogType.Error, new Regex("No Locale could be selected"));
 }