Пример #1
0
        public void VehiclesMapperTest()
        {
            var data = Vehicles();

            Assert.AreEqual(4, data.Count);

            var     findByIdData = _vehicleMapper.findById("3", db);
            Bicycle bicycle      = (Bicycle)findByIdData;

            Assert.AreEqual("3", bicycle.Id);
            Assert.AreEqual("Merida", bicycle.Manufacturer);
            Assert.AreEqual("5.5cm", bicycle.SaddleHeight);

            db.Rows.Add("4", "BMW", "7", "5", "100l", null, "Car");
            getVehicles();
            var newData   = _vehicleMapper.GetVehicles(db);
            var findById2 = _vehicleMapper.findById("4", db);
            Car car       = (Car)findById2;

            Assert.AreEqual(5, newData.Count);
            Assert.AreEqual("BMW", car.Manufacturer);
            Assert.AreEqual("100l", car.FuelTankCapacity);
        }
Пример #2
0
 private void getVehicles()
 {
     _vehicleMapper = new VehicleMapper();
     _vehicles      = _vehicleMapper.GetVehicles(db);
 }