Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • croban 25 posts 96 karma points
    Nov 20, 2015 @ 15:43
    croban
    0

    Testing Umbraco 7.3 Current has not been initialized on Umbraco.Core.Persistence.Mappers.MappingResolver

    this line works fine and if not found inside DB it creates new one.

    GetDictionaryItemByKey 
    

    next line GetDictionaryItemChildren throws Exception:

    System.InvalidOperationException : Current has not been initialized on Umbraco.Core.Persistence.Mappers.MappingResolver. You must initialize Current before trying to read it.
    

    here ist the whole test class

    [TestFixture] 
    public class TestImport : BaseUmbracoApplicationTest
            {
                [Test]
                public void TestImportDictionary()
                {
                    var dictContainer = ApplicationContext.Current.Services.LocalizationService.GetDictionaryItemByKey("Abteilungen.Intranet") ??
                                             ApplicationContext.Current.Services.LocalizationService.CreateDictionaryItemWithIdentity("Abteilungen.Intranet", null);
    
    
                    var children = ApplicationContext.Services.LocalizationService.GetDictionaryItemChildren(dictContainer.Key);
                }
            }
    
Please Sign in or register to post replies

Write your reply to:

Draft