Пример #1
0
        public void AddPolicyDetails_NewPolicyDetails_StatusOk()
        {
            //Arrange
            var controller    = new PolicyDetailsController(_policyDetailsService, _mapper, _log);
            var policyDetails = new PolicyDetailsDTO {
                IDTypeFuel = 4
            };

            //Act
            var result = controller.AddPolicyDetails(policyDetails);

            //Asserts
            result.Result.Should().BeOfType <OkResult>();
            _policyDetailsService.Received(1).AddPolicyDetails(Arg.Any <PolicyDetails>());
            _policyDetailsService.Received(1).SaveChanges();
            _log.Received(1).Save(Arg.Any <string>(), "Dodano szczegóły polisy", nameof(PolicyDetailsController));
        }
        public void AddParkingPlace_NewParkingPlace_StatusOk()
        {
            //Arrange
            var controller   = new ParkingPlaceController(_parkingPlaceService, _mapper, _log);
            var parkingPlace = new ParkingPlaceDTO {
                Place = "dom"
            };

            //Act
            var result = controller.AddParkingPlace(parkingPlace);

            //Asserts
            result.Result.Should().BeOfType <OkResult>();
            _parkingPlaceService.Received(1).AddParkingPlace(Arg.Any <ParkingPlace>());
            _parkingPlaceService.Received(1).SaveChanges();
            _log.Received(1).Save(Arg.Any <string>(), "Dodano rodzaj miejsca parkingowego", nameof(ParkingPlaceController));
        }