Esempio n. 1
0
        public void GetRegionsForSelectList_SentLanguageName_Get_ListOfTranslations(string name, int count)
        {
            //arrange
            var repository = new MapObjectTranslationsRepository(_datacontext);

            var manager = new MapObjectManager(repository);

            //act
            var result = manager.GetRegionsForSelectList(name);

            //assert
            Assert.AreEqual(result.Count, count);
        }
Esempio n. 2
0
        public void CreateMapObjectWithTranslation_CreateNew_CheckDataSourth(string values, int regionId, string languageKey)
        {
            //arrange
            var repository = new MapObjectTranslationsRepository(_datacontext);

            var manager = new MapObjectManager(repository);

            var translations = values.Split('-').ToArray().Select(value => new MapObjectTranslationData {Value = value, LanguageKey = languageKey, LanguageId = 1}).ToList();

            //act
            manager.CreateMapObjectWithTranslation(translations, regionId, languageKey);

            var result = _datacontext.CityNodes.FirstOrDefault(e => e.LanguageKey == languageKey); ;

            //assert
            Assert.IsNotNull(result);
        }
Esempio n. 3
0
        public void GetTranslationsFor_Send_CityNodeId_GetListMapObjectTranslationData(int id, int count)
        {
            //arrange
            var repository = new MapObjectTranslationsRepository(_datacontext);

            var manager = new MapObjectManager(repository);

            //act
            var result = manager.GetTranslationsFor(id);

            //assert
            Assert.AreEqual(result.Count, count);
        }
Esempio n. 4
0
 /// <summary>
 /// Processes the import map object.
 /// </summary>
 /// <param name="data">The data.</param>
 public void ProcessImportMapObject(List<MapObjectTranslationData> data)
 {
     using (var manager = new MapObjectManager())
     {
         manager.ProcessImportMapObject(data);
     }
 }
Esempio n. 5
0
 /// <summary>
 /// Gets the exported map object translation data.
 /// </summary>
 /// <returns>
 /// The list of <see cref="MapObjectTranslationData" />.
 /// </returns>
 public List<MapObjectTranslationData> GetExportedMapObjectTranslationData()
 {
     using (var manager = new MapObjectManager())
     {
         return manager.GetExportData();
     }
 }
Esempio n. 6
0
 /// <summary>
 /// Creates the map object with translation.
 /// </summary>
 /// <param name="translations">The translations.</param>
 /// <param name="regionId">The region identifier.</param>
 /// <param name="languageKey">The language key.</param>
 /// <exception cref="System.NotImplementedException"></exception>
 public void CreateMapObjectWithTranslation(List<MapObjectTranslationData> translations, int regionId, string languageKey)
 {
     using (var manager = new MapObjectManager())
     {
         manager.CreateMapObjectWithTranslation(translations, regionId, languageKey);
     }
 }
Esempio n. 7
0
 /// <summary>
 /// Gets the regions list for language.
 /// </summary>
 /// <param name="languageName">Name of the language.</param>
 /// <returns>The list of <see cref="ObjectTranslationsData"/>.</returns>
 public List<ObjectTranslationsData> GetRegionsListForLanguage(string languageName)
 {
     try
     {
         using (var manager = new MapObjectManager())
         {
             return manager.GetRegionsForSelectList(languageName);
         }
     }
     catch (Exception ex)
     {
         //TODO ADD tracking
         return new List<ObjectTranslationsData>();
     }
 }
Esempio n. 8
0
 /// <summary>
 /// Updates the map object translation.
 /// </summary>
 /// <param name="objectTranslations">The list of <see cref="MapObjectTranslationData" />.</param>
 public void UpdateMapObjectTranslation(List<MapObjectTranslationData> objectTranslations)
 {
     using (var manager = new MapObjectManager())
     {
         manager.UpdateMapObjectTranslation(objectTranslations);
     }
 }
Esempio n. 9
0
 /// <summary>
 /// Gets the map object translation data for.
 /// </summary>
 /// <param name="cityNodeId">The city node identifier.</param>
 /// <returns>The list of <see cref="MapObjectTranslationData"/></returns>
 public List<MapObjectTranslationData> GetMapObjectTranslationDataFor(long cityNodeId)
 {
     try
     {
         using (var manager = new MapObjectManager())
         {
             return manager.GetTranslationsFor(cityNodeId);
         }
     }
     catch (Exception ex)
     {
         //TODO ADD tracking
         return new List<MapObjectTranslationData>();
     }
 }