public void DeletePosts() { var posts = PostHydrador.GetList(1000); Bridge.InsertRange(posts); Bridge.DeleteRange(posts.Select(o => o.Id)); }
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); }
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 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); }
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); }