示例#1
0
        private void btnVehiculoLEliminar_Click(object sender, EventArgs e)
        {
            var row = dgvVehiculos.SelectedCells[0].OwningRow;

            var vehiculo = _context.Vehiculo.Find(Convert.ToInt32(row.Cells[0].Value));

            _vehiculoService.Delete(vehiculo);

            VehiculoLista_Load(sender, e);
        }
示例#2
0
        public void DeleteVehiculo_True(int id)
        {
            var mockVehiculoRepository = new Mock <IVehiculoRepository>();

            mockVehiculoRepository.Setup(sp => sp.Delete(id)).Returns(true);
            IVehiculoService vehiculoService = new VehiculoService(mockVehiculoRepository.Object);

            var resultado = vehiculoService.Delete(id);

            Assert.True(resultado);
        }