當前位置: 首頁>>代碼示例>>C#>>正文


C# DatabaseObjectProvider.UpdateConfigData方法代碼示例

本文整理匯總了C#中Subtext.Framework.Data.DatabaseObjectProvider.UpdateConfigData方法的典型用法代碼示例。如果您正苦於以下問題:C# DatabaseObjectProvider.UpdateConfigData方法的具體用法?C# DatabaseObjectProvider.UpdateConfigData怎麽用?C# DatabaseObjectProvider.UpdateConfigData使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Subtext.Framework.Data.DatabaseObjectProvider的用法示例。


在下文中一共展示了DatabaseObjectProvider.UpdateConfigData方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: SetupBlogForCommentsAndCreateEntry

        Entry SetupBlogForCommentsAndCreateEntry(DatabaseObjectProvider repository = null)
        {
            repository = repository ?? new DatabaseObjectProvider();
            repository.CreateBlog(string.Empty, "username", "password", _hostName, string.Empty);
            Blog info = repository.GetBlog(_hostName, string.Empty);
            BlogRequest.Current.Blog = info;
            info.Email = "[email protected]";
            info.Title = "You've been haacked";
            info.CommentsEnabled = true;
            info.ModerationEnabled = false;

            repository.UpdateConfigData(info);

            Entry entry = UnitTestHelper.CreateEntryInstanceForSyndication("blah", "blah", "blah");
            UnitTestHelper.Create(entry);
            return entry;
        }
開發者ID:rsaladrigas,項目名稱:Subtext,代碼行數:17,代碼來源:FeedbackTests.cs

示例2: GetBlogInfoLoadsOpenIDSettings

        public void GetBlogInfoLoadsOpenIDSettings()
        {
            var repository = new DatabaseObjectProvider();
            repository.CreateBlog("title", "username", "password", hostName, string.Empty);

            Blog info = repository.GetBlog(hostName, string.Empty);
            info.OpenIdServer = "http://server.example.com/";
            info.OpenIdDelegate = "http://delegate.example.com/";
            repository.UpdateConfigData(info);
            info = repository.GetBlog(hostName, string.Empty);

            Assert.AreEqual("http://server.example.com/", info.OpenIdServer);
            Assert.AreEqual("http://delegate.example.com/", info.OpenIdDelegate);
        }
開發者ID:rsaladrigas,項目名稱:Subtext,代碼行數:14,代碼來源:ConfigTests.cs

示例3: SettingShowEmailAddressInRssFlagDoesntChangeOtherFlags

        public void SettingShowEmailAddressInRssFlagDoesntChangeOtherFlags()
        {
            var repository = new DatabaseObjectProvider();
            repository.CreateBlog("title", "username", "password", hostName, string.Empty);
            Blog info = repository.GetBlog(hostName, string.Empty);
            bool test = info.IsAggregated;
            info.ShowEmailAddressInRss = false;
            repository.UpdateConfigData(info);
            info = repository.GetBlog(hostName, string.Empty);

            Assert.AreEqual(test, info.IsAggregated);
        }
開發者ID:rsaladrigas,項目名稱:Subtext,代碼行數:12,代碼來源:ConfigTests.cs

示例4: UpdatingBlogWithDuplicateHostNameRequiresSubfolderName

        public void UpdatingBlogWithDuplicateHostNameRequiresSubfolderName()
        {
            var repository = new DatabaseObjectProvider();
            string anotherHost = UnitTestHelper.GenerateUniqueString();
            repository.CreateBlog("title", "username", "password", _hostName, "MyBlog1");
            repository.CreateBlog("title", "username", "password", anotherHost, string.Empty);

            Blog info = repository.GetBlog(anotherHost, string.Empty);
            info.Host = _hostName;
            info.Subfolder = string.Empty;

            UnitTestHelper.AssertThrows<BlogRequiresSubfolderException>(() => repository.UpdateConfigData(info));
        }
開發者ID:rsaladrigas,項目名稱:Subtext,代碼行數:13,代碼來源:BlogCreationTests.cs

示例5: CannotRenameBlogToHaveSubfolderNameBin

        public void CannotRenameBlogToHaveSubfolderNameBin()
        {
            var repository = new DatabaseObjectProvider();
            repository.CreateBlog("title", "blah", "blah", _hostName, "Anything");
            Blog info = repository.GetBlog(_hostName, "Anything");
            info.Subfolder = "bin";

            UnitTestHelper.AssertThrows<InvalidSubfolderNameException>(() => repository.UpdateConfigData(info));
        }
開發者ID:rsaladrigas,項目名稱:Subtext,代碼行數:9,代碼來源:BlogCreationTests.cs

示例6: UpdatingBlogIsFine

 public void UpdatingBlogIsFine()
 {
     var repository = new DatabaseObjectProvider();
     repository.CreateBlog("title", "username", "password", _hostName, string.Empty);
     Blog info = repository.GetBlog(_hostName.ToUpper(CultureInfo.InvariantCulture), string.Empty);
     info.Author = "Phil";
     repository.UpdateConfigData(info); //Make sure no exception is thrown.
 }
開發者ID:rsaladrigas,項目名稱:Subtext,代碼行數:8,代碼來源:BlogCreationTests.cs

示例7: UpdatingBlogCannotHideAnotherBlog

        public void UpdatingBlogCannotHideAnotherBlog()
        {
            var repository = new DatabaseObjectProvider();
            repository.CreateBlog("title", "username", "password", "www.mydomain.com", string.Empty);

            Blog info = repository.GetBlog("www.mydomain.com", string.Empty);
            info.Host = "mydomain.com";
            info.Subfolder = "MyBlog";
            repository.UpdateConfigData(info);
        }
開發者ID:rsaladrigas,項目名稱:Subtext,代碼行數:10,代碼來源:BlogCreationTests.cs

示例8: UpdateBlogCannotConflictWithDuplicateHostAndSubfolder

        public void UpdateBlogCannotConflictWithDuplicateHostAndSubfolder()
        {
            var repository = new DatabaseObjectProvider();
            string secondHost = UnitTestHelper.GenerateUniqueString();
            repository.CreateBlog("title", "username", "password", _hostName, "MyBlog");
            repository.CreateBlog("title", "username2", "password2", secondHost, "MyBlog");
            Blog info = repository.GetBlog(secondHost, "MyBlog");
            info.Host = _hostName;

            UnitTestHelper.AssertThrows<BlogDuplicationException>(() => repository.UpdateConfigData(info));
        }
開發者ID:rsaladrigas,項目名稱:Subtext,代碼行數:11,代碼來源:BlogCreationTests.cs

示例9: ModifyingBlogShouldNotChangePassword

        public void ModifyingBlogShouldNotChangePassword()
        {
            var repository = new DatabaseObjectProvider();
            Config.Settings.UseHashedPasswords = true;
            repository.CreateBlog("", "username", "thePassword", _hostName, "MyBlog1");
            Blog info = repository.GetBlog(_hostName.ToUpper(CultureInfo.InvariantCulture), "MyBlog1");
            string password = info.Password;
            info.LicenseUrl = "http://subtextproject.com/";
            repository.UpdateConfigData(info);

            info = repository.GetBlog(_hostName.ToUpper(CultureInfo.InvariantCulture), "MyBlog1");
            Assert.AreEqual(password, info.Password);
        }
開發者ID:rsaladrigas,項目名稱:Subtext,代碼行數:13,代碼來源:BlogCreationTests.cs

示例10: CanUpdateMobileSkin

 public void CanUpdateMobileSkin()
 {
     var repository = new DatabaseObjectProvider();
     repository.CreateBlog("title", "username", "password", _hostName, string.Empty);
     Blog info = repository.GetBlog(_hostName.ToUpper(CultureInfo.InvariantCulture), string.Empty);
     info.MobileSkin = new SkinConfig { TemplateFolder = "Mobile", SkinStyleSheet = "Mobile.css" };
     repository.UpdateConfigData(info);
     Blog blog = repository.GetBlogById(info.Id);
     Assert.AreEqual("Mobile", blog.MobileSkin.TemplateFolder);
     Assert.AreEqual("Mobile.css", blog.MobileSkin.SkinStyleSheet);
 }
開發者ID:rsaladrigas,項目名稱:Subtext,代碼行數:11,代碼來源:BlogCreationTests.cs


注:本文中的Subtext.Framework.Data.DatabaseObjectProvider.UpdateConfigData方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。