Exemplo n.º 1
0
        public void Can_Perform_Count_On_RelationRepository()
        {
            // Arrange
            using (IScope scope = ScopeProvider.CreateScope())
            {
                RelationRepository repository = CreateRepository(ScopeProvider, out RelationTypeRepository repositoryType);

                // Act
                IQuery <IRelation> query = ScopeProvider.CreateQuery <IRelation>().Where(x => x.ParentId == _textpage.Id);
                int count = repository.Count(query);

                // Assert
                Assert.That(count, Is.EqualTo(2));
            }
        }
Exemplo n.º 2
0
        public void Can_Perform_Count_On_RelationRepository()
        {
            // Arrange
            var provider       = new PetaPocoUnitOfWorkProvider();
            var unitOfWork     = provider.GetUnitOfWork();
            var repositoryType = new RelationTypeRepository(unitOfWork);
            var repository     = new RelationRepository(unitOfWork, NullCacheProvider.Current, repositoryType);

            // Act
            var query = Query <Relation> .Builder.Where(x => x.ParentId == 1046);

            int count = repository.Count(query);

            // Assert
            Assert.That(count, Is.EqualTo(2));
        }
        public void Can_Perform_Count_On_RelationRepository()
        {
            // Arrange
            var provider = new PetaPocoUnitOfWorkProvider();
            var unitOfWork = provider.GetUnitOfWork();
            var repositoryType = new RelationTypeRepository(unitOfWork);
            var repository = new RelationRepository(unitOfWork, NullCacheProvider.Current, repositoryType);

            // Act
            var query = Query<Relation>.Builder.Where(x => x.ParentId == 1046);
            int count = repository.Count(query);

            // Assert
            Assert.That(count, Is.EqualTo(2));
        }