Example #1
0
        public void WhenActualizarLaMarcaNull()
        {
            _model    = new Model();
            _purchase = new Purchase(_model, _brand);
            var modelDomainService = new ModelDomainService();

            _resultado = modelDomainService.PutModelDomainService(id, _purchase);
        }
Example #2
0
        public void WhenActualizarElModelo()
        {
            _brand    = new Brand();
            _model    = null;
            _purchase = new Purchase(_model, _brand);
            var modelDomainService = new ModelDomainService();

            _resultado = modelDomainService.PutModelDomainService(id, _purchase);
        }
        public void PruebaParaValidarQueSeEncuentraUnaBrand2()
        {
            // Arrange
            var brand = new Brand();
            var model = new Model();
            var id    = new int();

            brand = null;
            var purchase = new Purchase(model, brand);
            // Act
            var modelDomainService = new ModelDomainService();
            var resultado          = modelDomainService.PutModelDomainService(id, purchase);

            // Assert
            Assert.AreEqual("No se encuentra la Marca", resultado);
        }
        public async Task <String> PutModelApplicationService(int id, Model model)
        {
            Purchase purchase = await DBCall(model);

            var responseDomainService = _modelDomainService.PutModelDomainService(id, purchase);

            bool errorInTheDomainService = responseDomainService != null;

            if (errorInTheDomainService)
            {
                return(responseDomainService);
            }

            _dataBase.Entry(model).State = EntityState.Modified;
            await _dataBase.SaveChangesAsync();

            return(null);
        }