﻿#if !NETFX_CORE
using UnityEngine;
using UnityEngine.TestTools;
using NUnit.Framework;
using System.Collections;
using UnityEngine.SceneManagement;
using I2.Loc;
using UnityEngine.UI;
using System;
#pragma warning disable 618


public partial class I2Loc_PlayTest_Features
{
    [UnityTest, Category("Features")]
    public IEnumerator I2LocTest_LocalizedString()
    {
        TestLogger.Enable();
        SceneManager.LoadScene("I2Localization    features LocalizedString");
        yield return null;
        TestLogger.Clear();

        I2Utils.FindObject("Canvas/Button Spanish").GetComponent<Button>().onClick.Invoke();
        yield return null;
        Assert.IsTrue(TestLogger.GetAllText(true) == "La traducción en español\r\nLa traducción en español\r\nLa traducción en español\r\nOtra traducción\r\nLa traducción en español\r\nEste es un ejemplo con números como 1, 2, 3 y etiquetas [color=#ffffff] como ésta [/color] y parámetros como Frank Puig y 123.\r\nEste es un ejemplo con números como 1, 2, 3 y etiquetas [color=#ffffff] como ésta [/color] y parámetros como Frank Puig y 123.\r\nEste es un ejemplo con números como 1, 2, 3 y etiquetas [color=#ffffff] como ésta [/color] y parámetros como Frank Puig y 123.\r\nEste es un ejemplo con números como 1, 2, 3 y etiquetas [color=#ffffff] como ésta [/color] y parámetros como Frank Puig y 123.\r\n");

        I2Utils.FindObject("Canvas/Button English").GetComponent<Button>().onClick.Invoke();
        yield return null;
        Assert.IsTrue(TestLogger.GetAllText(true) == "Translation in English\r\nTranslation in English\r\nTranslation in English\r\nAnother translation\r\nTranslation in English\r\nThis is an example with numbers like 1, 2, 3 and tags [color=#ffffff] like this one [/color] and parameters like Frank Puig and 123.\r\nThis is an example with numbers like 1, 2, 3 and tags [color=#ffffff] like this one [/color] and parameters like Frank Puig and 123.\r\nThis is an example with numbers like 1, 2, 3 and tags [color=#ffffff] like this one [/color] and parameters like Frank Puig and 123.\r\nThis is an example with numbers like 1, 2, 3 and tags [color=#ffffff] like this one [/color] and parameters like Frank Puig and 123.\r\n");

        I2Utils.FindObject("Canvas/Button Arabic").GetComponent<Button>().onClick.Invoke();
        yield return null;
        Assert.IsTrue(TestLogger.GetAllText(true) == "ﺔﻳﺰﻴﻠﺠﻧﻹا ﺔﻐﻠﻟﺎﺑ ﺔﻤﺟﺮﺗ\r\nﺔﻳﺰﻴﻠﺠﻧﻹا ﺔﻐﻠﻟﺎﺑ ﺔﻤﺟﺮﺗ\r\nﺔﻳﺰﻴﻠﺠﻧﻹا ﺔﻐﻠﻟﺎﺑ ﺔﻤﺟﺮﺗ\r\nىﺮﺧأ ﺔﻤﺟﺮﺗ\r\nﺔﻳﺰﻴﻠﺠﻧﻹا ﺔﻐﻠﻟﺎﺑ ﺔﻤﺟﺮﺗ\r\n123. و Frank Puig ﻞﺜﻣ تﺎﻤﻠﻌﻤﻟاو [color=#ffffff] ﺪﺣاو اﺬﻫ ﻞﺜﻣ [/color] تﺎﻣﻼﻌﻟاو 3 2، 1، ﻞﺜﻣ مﺎﻗرأ ﻊﻣ لﺎﺜﻣ ﻮﻫ اﺬﻫ\r\nهذا هو مثال مع أرقام مثل 1، 2، 3 والعلامات [color=#ffffff] مثل هذا واحد [/color] والمعلمات مثل Frank Puig و 123.\r\nمﺎﻗرأ ﻊﻣ لﺎﺜﻣ ﻮﻫ اﺬﻫ\r\nتﺎﻣﻼﻌﻟاو ٣ ٢، ١، ﻞﺜﻣ\r\n[color=#ffffff] ﺪﺣاو اﺬﻫ ﻞﺜﻣ [/color]\r\nFrank Puig ﻞﺜﻣ تﺎﻤﻠﻌﻤﻟاو\r\n١٢٣. و\r\nمﺎﻗرأ ﻊﻣ لﺎﺜﻣ ﻮﻫ اﺬﻫ\r\nتﺎﻣﻼﻌﻟاو ٣ ٢، ١، ﻞﺜﻣ\r\n[color=#ffffff] ﺪﺣاو اﺬﻫ ﻞﺜﻣ [/color]\r\nFrank Puig ﻞﺜﻣ تﺎﻤﻠﻌﻤﻟاو\r\n١٢٣. و\r\n");
    }
}

#endif