public void ReturnInstanceOfQuarable_WithValidaDataIsPassed() { // Arrange var carAdsServices = new CarAdServices( this.carAdsRepoMock.Object, this.carBrandsRepoMock, this.carModelsRepoMock, this.carFeatureServicesMock, this.unitOfWorkMocked); // Act var allCarAds = carAdsServices.GetAll(); // Assert Assert.IsInstanceOf <IQueryable <CarAd> >(allCarAds); }
public void Call_AllMethodFromRepositoryOnce() { // Arrange var carAdsServices = new CarAdServices( this.carAdsRepoMock.Object, this.carBrandsRepoMock, this.carModelsRepoMock, this.carFeatureServicesMock, this.unitOfWorkMocked); // Act carAdsServices.GetAll(); // Assert this.carAdsRepoMock.Verify(x => x.All, Times.Once); }
public void ReturnQueryable_WithExactNumberOfCarAds() { // Arrange var carAdsServices = new CarAdServices( this.carAdsRepoMock.Object, this.carBrandsRepoMock, this.carModelsRepoMock, this.carFeatureServicesMock, this.unitOfWorkMocked); // Act var allCarAdsCount = carAdsServices.GetAll().Count(); // Assert Assert.AreEqual(allCarAdsCount, this.carAds.Count()); }