public void ReturnCarFeatureServiceInstance_WhenCorrectDataIsPassed() { // Act var newCarFeatureServiceInstance = new CarFeaturesServices(this.carFeatureRepo); // Assert Assert.IsInstanceOf <ICarFeatureServices>(newCarFeatureServiceInstance); }
public void ReturnInstanceOfQuarable_WithValidaDataIsPassed() { // Arrange var carFeatureServices = new CarFeaturesServices(this.carFeaturesRepoMocked.Object); // Act var allCarFeaturesResult = carFeatureServices.GetAllCarFeatures(); // Assert Assert.IsInstanceOf <IQueryable <CarFeature> >(allCarFeaturesResult); }
public void Call_AllMethodFromRepositoryOnce() { // Arrange var carFeaturesServices = new CarFeaturesServices(this.carFeaturesRepoMocked.Object); // Act carFeaturesServices.GetAllCarFeatures(); // Assert this.carFeaturesRepoMocked.Verify(x => x.All, Times.Once); }
public void ReturnQueryable_WithExactNumberOfCarFeatures() { // Arrange var carFeatureServices = new CarFeaturesServices(this.carFeaturesRepoMocked.Object); // Act var expectedNumberOfCarFeatures = carFeatureServices.GetAllCarFeatures().Count(); // Assert Assert.AreEqual(expectedNumberOfCarFeatures, this.carFeatures.Count()); }