Пример #1
0
        public async Task <IActionResult> AddArea(AreaViewModel area)
        {
            try
            {
                await _areaServices.AddArea(area);

                return(Ok());
            }
            catch (Exception e)
            {
                return(BadRequest(e));
            }
        }
Пример #2
0
        public void CanAddArea()
        {
            //Create Additonal Area
            Area          expected = fakeAreaRepository.GenerateAdditionalArea();
            AreaViewModel _newArea = AreaViewModel.ToViewModel(expected);

            //Add Area
            _areaServices.AddArea(_newArea);
            // Actual Result
            Area result = fakeAreaRepository._fakeRepository.Last();

            // Assert
            expected.Should().BeEquivalentTo(result);
        }