Пример #1
0
        public void PruebaParaValidarQueSeEncuentraUnModelo3()
        {
            // Arrange
            var model = new Model();
            var brand = new Brand();
            var id    = new int();

            model = null;
            var purchase = new Purchase(model, brand);

            // Act
            var modelDomainService = new ModelDomainService();
            var resultado          = modelDomainService.DeleteModelDomainService(id, model);

            // Assert
            Assert.AreEqual("No se encuentra el Modelo", resultado);
        }
Пример #2
0
        public async Task <String> DeleteModelApplicationService(int id)
        {
            var model = await _dataBase.Models.FindAsync(id);

            var responseDomainService = _modelDomainService.DeleteModelDomainService(id, model);

            bool errorInTheDomainService = responseDomainService != null;

            if (errorInTheDomainService)
            {
                return(responseDomainService);
            }

            _dataBase.Models.Remove(model);
            await _dataBase.SaveChangesAsync();

            return(null);
        }
Пример #3
0
        public void WhenEliminarElModelo()
        {
            var modelDomainService = new ModelDomainService();

            _resultado = modelDomainService.DeleteModelDomainService(id, _model);
        }