public void DeleteParkingPlace_NonexistentParkingPlace_StatusNotFound()
        {
            //Arrange
            var controller = new ParkingPlaceController(_parkingPlaceService, _mapper, _log);

            //Act
            var result = controller.DeleteParkingPlace(2);

            //Asserts
            result.Should().BeOfType <NotFoundResult>();
            _parkingPlaceService.DidNotReceive().DeleteParkingPlace(Arg.Any <ParkingPlace>());
            _parkingPlaceService.DidNotReceive().SaveChanges();
            _log.DidNotReceive().Save(Arg.Any <string>(), Arg.Any <string>(), nameof(ParkingPlaceController));
        }
Esempio n. 2
0
        public void DeletePolicyDetails_NonexistentPolicyDetails_StatusNotFound()
        {
            //Arrange
            var controller = new PolicyDetailsController(_policyDetailsService, _mapper, _log);

            //Act
            var result = controller.DeletePolicyDetails(2);

            //Asserts
            result.Should().BeOfType <NotFoundResult>();
            _policyDetailsService.DidNotReceive().DeletePolicyDetails(Arg.Any <PolicyDetails>());
            _policyDetailsService.DidNotReceive().SaveChanges();
            _log.DidNotReceive().Save(Arg.Any <string>(), Arg.Any <string>(), nameof(PolicyDetailsController));
        }