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()); }
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()); }
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()); }
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()); }
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()); }
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()); }