Inheritance: Castle.ActiveRecord.ActiveRecordBase
Exemple #1
0
		public Post(Blog blog, String title, String contents, String category)
		{
			_blog = blog;
			_title = title;
			_contents = contents;
			_category = category;
		}
		public void SimpleUsage()
		{
			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.Save();

			blogs = Blog.FindAll();

			Assert.IsNotNull( blogs );
			Assert.AreEqual( 1, blogs.Length );

			Blog retrieved = blogs[0];
			Assert.IsNotNull( retrieved );

			Assert.AreEqual( blog.Name, retrieved.Name );
			Assert.AreEqual( blog.Author, retrieved.Author );
		}