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");
            };
        }
Esempio n. 2
0
        void before_each()
        {
            seed = new Seed();

            blogs = new Blogs();

            comments = new Comments();
        }
Esempio n. 3
0
        void before_each()
        {
            blogs = new Blogs();

            blogs.Projection = d => new BlogWithAutoProps(d).InitializeExtensions();

            comments = new Comments();

            comments.Projection = d => new CommentWithAutoProps(d).InitializeExtensions();
        }
Esempio n. 4
0
        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");
        }
Esempio n. 5
0
        public UnconventionalComment2(dynamic dto)
        {
            blogs = new Blogs();

            Init(dto);
        }
Esempio n. 6
0
        void before_each()
        {
            blogs = new Blogs();

            comments = new Comments();
        }
Esempio n. 7
0
        public Comment(dynamic dto)
        {
            blogs = new Blogs();

            Init(dto);
        }