Esempio n. 1
0
 private void AssertsVehicleMapping(CM.Vehicle contract, EM.Vehicle entity)
 {
     Assert.IsTrue(entity != null);
     Assert.IsTrue(entity.Year == contract.Year);
     Assert.IsTrue(entity.Make == contract.Make);
     Assert.IsTrue(entity.Model == contract.Model);
     Assert.IsTrue(entity.ChassisNotation == contract.ChassisNotation);
     Assert.IsTrue(entity.EngineNotation == contract.EngineNotation);
     Assert.IsTrue(entity.Transmission == contract.Transmission);
     Assert.IsTrue(entity.ForwardGears == contract.ForwardGears);
     Assert.IsTrue(entity.ExteriorColor == contract.ExteriorColor);
     Assert.IsTrue(entity.InteriorColor == contract.InteriorColor);
 }
Esempio n. 2
0
        private void VehicleMappingTests()
        {
            CM.Vehicle        contract     = CreateContractVehicle();
            List <CM.Vehicle> contractList = CreateContractVehicleList();

            EM.Vehicle        entity     = _mapper.Map <EM.Vehicle>(contract);
            List <EM.Vehicle> entityList = _mapper.Map <List <EM.Vehicle> >(contractList);

            AssertsVehicleMapping(contract, entity);

            Assert.IsTrue(entityList.Count > 0);
            for (int i = 0; i < entityList.Count; i++)
            {
                AssertsVehicleMapping(contractList[i], entityList[i]);
            }
        }