コード例 #1
0
        public void PetaPocoRepository_Find_Returns_Correct_Rows(int count, string sqlCondition, object arg)
        {
            //Arrange
            var mockCache = new Mock <ICacheProvider>();

            SetUpDatabase(TestConstants.PETAPOCO_RecordCount);

            var repository = new PetaPocoRepository <Dog>(_petaPocoUnitOfWork, mockCache.Object);

            //Act
            IEnumerable <Dog> dogs = repository.Find(sqlCondition, arg);

            //Assert
            Assert.AreEqual(count, dogs.Count());
        }
コード例 #2
0
        public void PetaPocoRepository_Find_Returns_Correct_Rows(int count, string sqlCondition, object arg)
        {
            //Arrange
            var db     = CreatePecaPocoDatabase();
            var mapper = new PetaPocoMapper(String.Empty);

            DataUtil.SetUpDatabase(Constants.PETAPOCO_RecordCount);

            var repository = new PetaPocoRepository <Dog>(db, mapper);

            //Act
            IEnumerable <Dog> dogs = repository.Find(sqlCondition, arg);

            //Assert
            Assert.AreEqual(count, dogs.Count());
        }
コード例 #3
0
        public void PetaPocoRepository_Find_Overload_Returns_Correct_Rows()
        {
            //Arrange
            var count     = 4;
            var mockCache = new Mock <ICacheProvider>();

            SetUpDatabase(TestConstants.PETAPOCO_RecordCount);

            var repository = new PetaPocoRepository <Dog>(_petaPocoUnitOfWork, mockCache.Object);

            //Act
            IEnumerable <Dog> dogs = repository.Find((d) => d.Age <= 5);

            //Assert
            Assert.AreEqual(count, dogs.Count());
        }
コード例 #4
0
        public void PetaPocoRepository_Find_Returns_Correct_Rows(int count, string sqlCondition, object arg)
        {
            //Arrange
            var db = CreatePecaPocoDatabase();
            var mapper = new PetaPocoMapper(String.Empty);

            DataUtil.SetUpDatabase(Constants.PETAPOCO_RecordCount);

            var repository = new PetaPocoRepository<Dog>(db, mapper);

            //Act
            IEnumerable<Dog> dogs = repository.Find(sqlCondition, arg);

            //Assert
            Assert.AreEqual(count, dogs.Count());
        }
コード例 #5
0
        public void PetaPocoRepository_Find_Overload_Returns_Correct_Rows()
        {
            //Arrange
            var count = 4;
            var mockCache = new Mock<ICacheProvider>();
            SetUpDatabase(TestConstants.PETAPOCO_RecordCount);

            var repository = new PetaPocoRepository<Dog>(_petaPocoUnitOfWork, mockCache.Object);

            //Act
            IEnumerable<Dog> dogs = repository.Find((d) => d.Age <= 5);

            //Assert
            Assert.AreEqual(count, dogs.Count());
        }
コード例 #6
0
        public void PetaPocoRepository_Find_Returns_Correct_Rows(int count, string sqlCondition, object arg)
        {
            //Arrange
            var mockCache = new Mock<ICacheProvider>();
            SetUpDatabase(TestConstants.PETAPOCO_RecordCount);

            var repository = new PetaPocoRepository<Dog>(_petaPocoUnitOfWork, mockCache.Object);

            //Act
            IEnumerable<Dog> dogs = repository.Find(sqlCondition, arg);

            //Assert
            Assert.AreEqual(count, dogs.Count());
        }