void describe_cacheing() { before = () => { blogs = new Blogs(); comments = new Comments(); CreateConventionalBlogTable(); CreateConventionalCommentTable(); blogId = new { Title = "Some Blog", Body = "Lorem Ipsum" }.InsertInto("Blogs"); commentId = new { BlogId = blogId, Text = "Comment 1" }.InsertInto("Comments"); }; act = () => { comment = comments.Single(commentId); comment.Blog(); }; context["belongs to props are changed from external source"] = () => { act = () => blogs.Update(new { Title = "Other Title" }, blogId as object); it["belongs to properties in comments remain unchanged"] = () => (comment.Blog().Title as string).should_be("Some Blog"); it["discarded cache updates properties"] = () => (comment.Blog(discardCache: true).Title as string).should_be("Other Title"); }; }
void before_each() { seed = new Seed(); blogs = new Blogs(); comments = new Comments(); }
void before_each() { blogs = new Blogs(); blogs.Projection = d => new BlogWithAutoProps(d).InitializeExtensions(); comments = new Comments(); comments.Projection = d => new CommentWithAutoProps(d).InitializeExtensions(); }
void describe_retrieval_of_belongs_to() { context["given blogs that have many comments"] = () => { before = () => { comments = new Comments(); CreateConventionalBlogTable(); CreateConventionalCommentTable(); blogId = new { Title = "Some Blog", Body = "Lorem Ipsum" }.InsertInto("Blogs"); commentId = new { BlogId = blogId, Text = "Comment 1" }.InsertInto("Comments"); }; VerifyBelongsToRetrieval(); }; }
void before_each() { seed = new Seed(); seed.PurgeDb(); blogs = new Blogs(); blogs.Projection = d => new BlogWithAutoProps(d).InitializeExtensions(); comments = new Comments(); (comments as Comments).Projection = d => new CommentWithAutoProps(d).InitializeExtensions(); CreateBlogTable(); CreateCommentTable(); blogId = new { Title = "Some Blog", Body = "Lorem Ipsum" }.InsertInto("Blogs"); commentId = new { BlogId = blogId, Text = "Comment 1" }.InsertInto("Comments"); }
public Blog(dynamic entity) { comments = new Comments(); Init(entity); }
void before_each() { blogs = new Blogs(); comments = new Comments(); }