public void DeletePosts()
        {
            var posts = PostHydrador.GetList(1000);
            Bridge.InsertRange(posts);

            Bridge.DeleteRange(posts.Select(o => o.Id));
        }
        public void DeletePost()
        {
            var post = PostHydrador.GetSingle();
            Bridge.Insert(post);

            Bridge.Delete(post.Id);
        }
Beispiel #3
0
        public void UpdatePost()
        {
            var post = PostHydrador.GetSingle();

            Bridge.Insert(post);

            post.Title = "Changed title!";

            Bridge.Update(post.Id, post);
        }
Beispiel #4
0
        public void GetPost()
        {
            var post = PostHydrador.GetSingle();

            Bridge.Insert(post);

            var receivedPost = Bridge.Get <Post>(post.Id);

            Assert.IsNotNull(receivedPost);
            Assert.AreEqual(post.Id, receivedPost.Id);
        }
        public void UpdatePost()
        {
            var post = PostHydrador.GetSingle();
            Bridge.Insert(post);

            post.Title = "Changed title!";

            Bridge.Update(post.Id, post);

            post = Bridge.Get(post.Id) as Post;
            Assert.AreEqual("Changed title!", post.Title);
        }
Beispiel #6
0
        public void GetPagedPosts()
        {
            var posts = PostHydrador.GetList(50);

            Bridge.InsertRange(posts);

            var range         = Bridge.Query <Post>();
            var receivedPosts = range
                                .Page(20)
                                .ToList();

            Assert.IsNotNull(receivedPosts);
            Assert.AreEqual(20, receivedPosts.Count);
        }
Beispiel #7
0
        public void GetPosts()
        {
            var range      = Bridge.Query <Post>();
            int startCount = range.Count();

            var posts = PostHydrador.GetList(1000);

            Bridge.InsertRange(posts);

            var receivedPosts = range.ToList();

            Assert.IsNotNull(receivedPosts);
            Assert.AreEqual(posts.Count, receivedPosts.Count - startCount);
        }
        public void UpdatePostUpdatesIndexes()
        {
            var post = PostHydrador.GetSingle();
            Bridge.Insert(post);

            post.Title = "Changed title!";

            Bridge.Update(post.Id, post);

            var match = Bridge.Query<Post>()
                .Filter(new Eq(new Field("Title"), new Literal("Changed title!")))
                .Count();

            Assert.AreEqual(1, match);
        }
Beispiel #9
0
        public void GetTitledModels()
        {
            int startCount = Bridge.Query <Post>().Count();

            var titledModels = PostHydrador.GetList(800).Cast <ITitled>()
                               .Union(LinkHydrador.GetList(200))
                               .ToList();

            Bridge.InsertRange(titledModels);

            var receivedPosts = Bridge.Query <ITitled>().ToList();

            Assert.IsNotNull(receivedPosts);
            Assert.AreEqual(titledModels.Count, receivedPosts.Count - startCount);
        }
Beispiel #10
0
        public void GetFilteredPosts()
        {
            int startCount = Bridge.Query <Post>().Count();

            var posts = PostHydrador.GetList(1000);

            Bridge.InsertRange(posts);

            string contentFullName = typeof(IContent).FullName;
            var    receivedPosts   = Bridge.Query <Post>()
                                     .Filter(new And(
                                                 leftFilter: new Eq(new Field("Title"), new Literal(posts.First().Title)),
                                                 rightFilter: new Eq(new Field("Author"), new Literal(posts.First().Author))
                                                 ))
                                     .ToList();

            Assert.IsNotNull(receivedPosts);
            Assert.AreEqual(1, receivedPosts.Count);
        }
        public void InsertPosts()
        {
            var posts = PostHydrador.GetList(1000);

            Bridge.InsertRange(posts);
        }
        public void InsertPost()
        {
            var post = PostHydrador.GetSingle();

            Bridge.Insert(post);
        }