public void MockCanLoadVehiclesBySearchTermYear(string year, int expectedCount) { var repo = new VehicleRepositoryMock(); var vehiclesDetail = repo.GetBySearchTerm(year).ToList(); Assert.IsNotEmpty(vehiclesDetail); Assert.AreEqual(expectedCount, vehiclesDetail.Count()); }
public void MockCanLoadVehicles() { var repo = new VehicleRepositoryMock(); var vehiclesDetail = repo.GetAllDetails(); Assert.IsNotNull(vehiclesDetail); Assert.AreEqual(4, vehiclesDetail.Count()); }
public void MockCanLoadSingleVehicleBySearchTermMake(string make, int expectedId) { var repo = new VehicleRepositoryMock(); var vehiclesDetail = repo.GetBySearchTerm(make).ToList(); Assert.IsNotEmpty(vehiclesDetail); Assert.AreEqual(1, vehiclesDetail.Count()); Assert.AreEqual(expectedId, vehiclesDetail[0].VehicleId); }
public void MockCanLoadVehiclesByYearRange() { var repo = new VehicleRepositoryMock(); var vehiclesDetail = repo.GetByYearRange(1995, 2015).ToList(); Assert.IsNotEmpty(vehiclesDetail); Assert.AreEqual(2, vehiclesDetail.Count()); Assert.AreEqual(2, vehiclesDetail[0].VehicleId); Assert.AreEqual(4, vehiclesDetail[1].VehicleId); }
public void MockCanLoadFeaturedVehicles() { var repo = new VehicleRepositoryMock(); var vehiclesFeatured = repo.GetFeatured().ToList(); Assert.IsNotNull(vehiclesFeatured); Assert.AreEqual(4, vehiclesFeatured.Count()); Assert.AreEqual(11000m, vehiclesFeatured[0].SalePrice); Assert.AreEqual("BMW", vehiclesFeatured[1].Make); Assert.AreEqual("Frontier", vehiclesFeatured[2].Model); }
public void MockCanLoadVehicleDetailById(int id, string expectedMake, string expectedModel, string expectedBodyStyle, string expectedInteriorColor, string expectedExteriorColor, int expectedYear) { var repo = new VehicleRepositoryMock(); var vehicleDetail = repo.GetDetailById(id); Assert.IsNotNull(vehicleDetail); Assert.AreEqual(expectedModel, vehicleDetail.Model); Assert.AreEqual(expectedBodyStyle, vehicleDetail.BodyStyle); Assert.AreEqual(expectedExteriorColor, vehicleDetail.ExteriorColor); Assert.AreEqual(expectedInteriorColor, vehicleDetail.InteriorColor); Assert.AreEqual(expectedYear, vehicleDetail.Year); }
public VehicleSpecificationTests() { _vehicleRepo = new VehicleRepositoryMock(); }