Beispiel #1
0
        public void GetPageModel_LanguageSelector_Success() // See TSI-2225
        {
            string testPageUrlPath = TestLocalization.GetAbsoluteUrlPath(TestFixture.Tsi2225PageRelativeUrlPath);

            PageModel pageModel = TestContentProvider.GetPageModel(testPageUrlPath, TestLocalization, addIncludes: false);

            Assert.IsNotNull(pageModel, "pageModel");
            OutputJson(pageModel);

            Common.Models.Configuration configEntity = pageModel.Regions["Nav"].Entities[0] as Common.Models.Configuration;
            Assert.IsNotNull(configEntity, "configEntity");
            string rawCompLink = TestLocalization.GetCmUri("9712");

            Assert.AreEqual(rawCompLink, configEntity.Settings["defaultContentLink"], "configEntity.Settings['defaultContentLink']");
            Assert.AreEqual("pt,mx", configEntity.Settings["suppressLocalizations"], "configEntity.Settings['suppressLocalizations']");
        }
Beispiel #2
0
        public async Task <Common.Models.Configuration> GetConfigurationAsync()
        {
            var config = new Common.Models.Configuration();

            try
            {
                var data = await _database.Table <Models.Data.ConfigurationItem>().ToListAsync();

                if (DateTime.TryParse(data.FirstOrDefault(r => r.Alias == Constants.LatestContentUpdatePropertyAlias).Value.ToString(), out DateTime _lastUpdate))
                {
                    config.LatestContentUpdate = _lastUpdate;
                }
            }
            catch
            {
                //table empty
            }

            return(config);
        }