Esempio n. 1
0
        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());
        }
Esempio n. 2
0
        public void MockCanLoadVehicles()
        {
            var repo           = new VehicleRepositoryMock();
            var vehiclesDetail = repo.GetAllDetails();

            Assert.IsNotNull(vehiclesDetail);
            Assert.AreEqual(4, vehiclesDetail.Count());
        }
Esempio n. 3
0
        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);
        }
Esempio n. 4
0
        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);
        }
Esempio n. 5
0
        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);
        }
Esempio n. 6
0
        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();
 }