本文整理汇总了C#中Castle.ActiveRecord.Tests.Model.Blog.Update方法的典型用法代码示例。如果您正苦于以下问题:C# Blog.Update方法的具体用法?C# Blog.Update怎么用?C# Blog.Update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Castle.ActiveRecord.Tests.Model.Blog
的用法示例。
在下文中一共展示了Blog.Update方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SimpleOperations2
public void SimpleOperations2()
{
ActiveRecordStarter.Initialize(GetConfigSource(), typeof(Post), typeof(Blog));
Recreate();
Post.DeleteAll();
Blog.DeleteAll();
Blog[] blogs = Blog.FindAll();
Assert.IsNotNull(blogs);
Assert.AreEqual(0, blogs.Length);
Blog blog = new Blog();
blog.Name = "hammett's blog";
blog.Author = "hamilton verissimo";
blog.Create();
blogs = Blog.FindAll();
Assert.AreEqual(blog.Name, blogs[0].Name);
Assert.AreEqual(blog.Author, blogs[0].Author);
Assert.IsNotNull(blogs);
Assert.AreEqual(1, blogs.Length);
blog.Name = "something else1";
blog.Author = "something else2";
blog.Update();
blogs = Blog.FindAll();
Assert.IsNotNull(blogs);
Assert.AreEqual(1, blogs.Length);
Assert.AreEqual(blog.Name, blogs[0].Name);
Assert.AreEqual(blog.Author, blogs[0].Author);
}