public async Task <String> DeleteCarApplicationService(int id)
        {
            var car = await _dataBase.Cars.FindAsync(id);

            var responseDomainService = _carDomainService.DeleteCarDomainService(id, car);

            bool hayErrorEnElDomainService = responseDomainService != null;

            if (hayErrorEnElDomainService)
            {
                return(responseDomainService);
            }

            _dataBase.Cars.Remove(car);
            await _dataBase.SaveChangesAsync();

            return(null);
        }
Beispiel #2
0
        public void PruebaParaValidarQueSeEncuentraUnCarro3()
        {
            // Arrange
            var model     = new Model();
            var brand     = new Brand();
            var car       = new Car();
            var photo     = new Photo();
            var status    = new Status();
            var seller    = new Seller();
            var condition = new Condition();
            var id        = new int();

            car = null;
            var purchase = new Purchase(car, model, photo, status, seller, condition);

            // Act
            var carDomainService = new CarDomainService();
            var resultado        = carDomainService.DeleteCarDomainService(id, car);

            // Assert
            Assert.AreEqual("No se encuentra el Vehiculo", resultado);
        }
Beispiel #3
0
        public void WhenEliminarElCarro()
        {
            var carDomainService = new CarDomainService();

            _resultado = carDomainService.DeleteCarDomainService(id, _car);
        }