public async Task <ActionResult <Digitalization> > PostDigitalization(Digitalization digitalization)
        {
            _context.Digitalizations.Add(digitalization);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetDigitalization", new { id = digitalization.Id }, digitalization));
        }
        public async Task <IActionResult> PutDigitalization(int id, Digitalization digitalization)
        {
            if (id != digitalization.Id)
            {
                return(BadRequest());
            }

            _context.Entry(digitalization).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!DigitalizationExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
Ejemplo n.º 3
0
        public void DigitalizeMap_PositiveTest()
        {
            Map testMap = new Map();

            testMap.map = _map;
            testMap     = Digitalization.digitalizeMap(testMap, 0.3, 0.3);
            testMap.digitalized[0, 0].Should().Be(0);
            testMap.digitalized[2, 2].Should().Be(1);
        }