public void EFLinqRepository_Find_Returns_Instance_Of_Model_If_Valid_Property() { //Arrange SetUpDatabase(5); var dogName = _dogNames[2]; var repository = new EFLinqRepository <Dog>(_efUnitOfWork, _cache.Object); //Act var dog = repository.Find((d) => d.Name == dogName).FirstOrDefault(); //Assert Assert.IsInstanceOf <Dog>(dog); }
public void EFLinqRepository_Find_Returns_List_Of_Models_If_Valid_Property(string dogName, int count) { //Arrange SetUpDatabase(5); var repository = new EFLinqRepository <Dog>(_efUnitOfWork, _cache.Object); //Act var dogs = repository.Find((d) => d.Name == dogName); //Assert Assert.IsInstanceOf <IEnumerable <Dog> >(dogs); Assert.AreEqual(count, dogs.Count()); }
public void EFLinqRepository_Find_Returns_Empty_List_If_InValid_Proeprty() { //Arrange SetUpDatabase(5); const string dogName = "Invalid"; var repository = new EFLinqRepository <Dog>(_efUnitOfWork, _cache.Object); //Act var dogs = repository.Find((d) => d.Name == dogName); //Assert Assert.IsInstanceOf <IEnumerable <Dog> >(dogs); Assert.AreEqual(0, dogs.Count()); }
public void EFLinqRepository_Find_Returns_Models_With_Correct_Properties(string dogName) { //Arrange SetUpDatabase(5); var repository = new EFLinqRepository <Dog>(_efUnitOfWork, _cache.Object); //Act var dogs = repository.Find((d) => d.Name == dogName); //Assert foreach (Dog dog in dogs) { Assert.AreEqual(dogName, dog.Name); } }
public void EFLinqRepository_Find_Returns_Models_With_Correct_Properties(string dogName) { //Arrange SetUpDatabase(5); var repository = new EFLinqRepository<Dog>(_efUnitOfWork, _cache.Object); //Act var dogs = repository.Find((d) => d.Name == dogName); //Assert foreach (Dog dog in dogs) { Assert.AreEqual(dogName, dog.Name); } }
public void EFLinqRepository_Find_Returns_Empty_List_If_InValid_Proeprty() { //Arrange SetUpDatabase(5); const string dogName = "Invalid"; var repository = new EFLinqRepository<Dog>(_efUnitOfWork, _cache.Object); //Act var dogs = repository.Find((d) => d.Name == dogName); //Assert Assert.IsInstanceOf<IEnumerable<Dog>>(dogs); Assert.AreEqual(0, dogs.Count()); }
public void EFLinqRepository_Find_Returns_Instance_Of_Model_If_Valid_Property() { //Arrange SetUpDatabase(5); var dogName = _dogNames[2]; var repository = new EFLinqRepository<Dog>(_efUnitOfWork, _cache.Object); //Act var dog = repository.Find((d) => d.Name == dogName).FirstOrDefault(); //Assert Assert.IsInstanceOf<Dog>(dog); }
public void EFLinqRepository_Find_Returns_List_Of_Models_If_Valid_Property(string dogName, int count) { //Arrange SetUpDatabase(5); var repository = new EFLinqRepository<Dog>(_efUnitOfWork, _cache.Object); //Act var dogs = repository.Find((d) => d.Name == dogName); //Assert Assert.IsInstanceOf<IEnumerable<Dog>>(dogs); Assert.AreEqual(count, dogs.Count()); }