本文整理汇总了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;
}
示例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);
}
示例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);
}
示例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));
}
示例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));
}
示例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.
}
示例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);
}
示例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));
}
示例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);
}
示例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);
}