Exemple #1
0
        public void Try_GetLanguages()
        {
            WorkspaceItem[] languagesReadFromDb = _agent.GetLanguages().ToArray();
            var             languagesToGenerate = ExplorerDomainGenerator.GetEnumerationItemsLanguages();

            foreach (WorkspaceItem language in languagesReadFromDb)
            {
                Logger.InfoFormat("Languge ( {0} )", language);
            }
            Assert.AreEqual(languagesReadFromDb.Count(), languagesToGenerate.Count());
            DebugWriteFinished("Try_GetLanguages finished on {0}");
        }
        /// <summary>
        /// Gets the enumeration languages.
        /// </summary>
        /// <returns></returns>
        public IEnumerable <Enumeration> GetEnumerationLanguages()
        {
            var enumerationItemsLanguages = ExplorerDomainGenerator.GetEnumerationItemsLanguages();

            return(enumerationItemsLanguages.Select(enumerationItemLanguage => new Enumeration
            {
                Id = enumerationItemLanguage.Id,
                SortOrder = enumerationItemLanguage.SortOrder,
                Title = enumerationItemLanguage.Title,
                TypeId = enumerationItemLanguage.TypeId,
                Image = enumerationItemLanguage.Image,
                DateModified = enumerationItemLanguage.DateModified
            }));
        }