コード例 #1
0
        public void ProjectionQuery_Ask_Success()
        {
            var spec = new UberProductSpec();
            var q    = new ProjectionQuery <UberProductSpec, Product, ProductDto>(_linqProvider, new StaticAutoMapperWrapper());
            var res  = q.Ask(spec);

            Assert.Equal(1, res.Count());
        }
コード例 #2
0
        public void PagedQuery_Ask_TotalCountAndResultAreRight()
        {
            var spec        = new UberProductSpec();
            var res         = _productQuery.AsPaged().Ask(spec);
            var nonPagedRes = _productQuery.Ask(spec);
            var totalCount  = ((IQuery <UberProductSpec, int>)_productQuery).Ask(spec);

            Assert.Equal(1, res.TotalCount);
            Assert.Equal(res.TotalCount, totalCount);
            Assert.Equal(res.Count(), nonPagedRes.Count());
        }