Ejemplo n.º 1
0
        public void Init(BookDataManager _manager, WordInfo _wordInfo, bool _selected)
        {
            myWordInfo = _wordInfo;
            myManager  = _manager;
            uIButton   = GetComponent <UIButton>();

            if (myWordInfo.unlocked || AppManager.I.Player.IsDemoUser)
            {
                OkIcon.enabled = true;
            }
            else
            {
                OkIcon.enabled = false;
            }

            Title.SetText(myWordInfo.data.Text);
            Title.SetTextAlign(LanguageSwitcher.I.IsLearningLanguageRTL());
            SubTitle.text = AppManager.I.ParentEdition.ShowHelpText ? myWordInfo.data.Id : "";

            if (myWordInfo.data.Drawing != "")
            {
                Drawing.SetLetterData(new LL_ImageData(myWordInfo.data));
            }
            else
            {
                Drawing.text = "";
            }

            highlight(_selected);
        }
        public void GetAll_returnFirstId_bk101()
        {
            //arrange
            string excpected = "bk101";

            //act
            BookDataManager bm     = new BookDataManager(DataManagerType.Book + ".xml");
            string          actual = bm.GetAll()[0].Id;

            //assert
            Assert.AreEqual(excpected, actual);
        }
        public void Search()
        {
            //arrange
            string          query          = "Kim";
            BookDataManager bm             = new BookDataManager(DataManagerType.Book + ".xml");
            List <Entity>   actualEntities = bm.GetAll();

            string excpected = "Midnight Rain";

            //act
            string actual = bm.Search(query, actualEntities)[0];

            //assert
            Assert.AreEqual(excpected, actual);
        }