Esempio n. 1
0
        public async Task <IActionResult> UpdateArea(AreaViewModel area)
        {
            try
            {
                await _areaServices.UpdateArea(area);

                return(Ok());
            }
            catch (Exception e)
            {
                return(BadRequest(e));
            }
        }
        public void CuandoUpdateArea()
        {
            //Arrange
            Area area = new Area {
                Nombre = "Redes", Descripcion = "Infraestructuras de Redes"
            };
            //Act
            IAreaServices areaServices = Substitute.For <IAreaServices>();
            var           result       = areaServices.UpdateArea(area);

            //Assert
            Assert.IsNotNull(result);
        }
Esempio n. 3
0
        public void CanUpdateArea()
        {
            //Create Updated Area
            Area          updatedArea  = fakeAreaRepository.GenerateUpdatedArea();
            AreaViewModel _updatedArea = AreaViewModel.ToViewModel(updatedArea);

            //Update Area
            _areaServices.UpdateArea(_updatedArea);
            // Expected Result
            Area expected = updatedArea;
            // Actual Result
            Area result = fakeAreaRepository._fakeRepository.First();

            // Assert
            expected.Should().BeEquivalentTo(result);
        }
 public async Task <int> UpdateArea(Area area)
 {
     return(await _areaServices.UpdateArea(area));
 }