public void BasicApiDictionaryTest()
        {
            var appCtx = ApplicationContext.EnsureContext(
                new DatabaseContext(Mock.Of <IDatabaseFactory>(), Mock.Of <ILogger>(), new SqlSyntaxProviders(new[] { Mock.Of <ISqlSyntaxProvider>() })),
                new ServiceContext(),
                CacheHelper.CreateDisabledCacheHelper(),
                new ProfilingLogger(
                    Mock.Of <ILogger>(),
                    Mock.Of <IProfiler>()), true);

            var ctx = UmbracoContext.EnsureContext(
                Mock.Of <HttpContextBase>(),
                appCtx,
                new Mock <WebSecurity>(null, null).Object,
                Mock.Of <IUmbracoSettingsSection>(),
                Enumerable.Empty <IUrlProvider>(), true);

            //Set ApplicationContext and UmbracoContext

            var test_value = "test";
            var test_key   = "Test Key";

            var valueDict = new Dictionary <string, string>()
            {
                { test_key, test_value }
            };

            //we can create a mock of the culture dictionary interface and set any value we want
            var mockDict = new Mock <ICultureDictionary>();

            //setup our mock dictionary to passthrough to our local dictionary
            mockDict.Setup(s => s[It.IsAny <string>()]).Returns <string>(key => valueDict[key]);

            //This time we use the larger constructor for the Helper. In ther we will set the dictionary that we mocked
            var helper = new UmbracoHelper(ctx,
                                           Mock.Of <IPublishedContent>(), Mock.Of <ITypedPublishedContentQuery>(),
                                           Mock.Of <IDynamicPublishedContentQuery>(),
                                           Mock.Of <ITagQuery>(),
                                           Mock.Of <IDataTypeService>(),
                                           new UrlProvider(ctx, Mock.Of <IWebRoutingSection>(section =>
                                                                                             section.UrlProviderMode == UrlProviderMode.Auto.ToString()),
                                                           new[] { Mock.Of <IUrlProvider>() }),
                                           mockDict.Object, //<--- set the dictionary
                                           Mock.Of <IUmbracoComponentRenderer>(),
                                           new MembershipHelper(ctx, Mock.Of <MembershipProvider>(), Mock.Of <RoleProvider>()));

            var controller = new BasicUmbracoApiController(ctx, helper);
            var res        = controller.BasicDictionaryAction(test_key);

            Assert.AreEqual(test_value, res);
        }
        public void EngineApiDictionaryTest()
        {
            var key   = "Test Key";
            var value = "test";

            _unitTestEngine.WithDictionaryValue(key, value);

            var controller = new BasicUmbracoApiController(_unitTestEngine.UmbracoContext, _unitTestEngine.UmbracoHelper);

            _unitTestEngine.RegisterController(controller);
            var res = controller.BasicDictionaryAction(key);

            Assert.AreEqual(value, res);
        }