public void ModifyChargeIsSuccessful()
            {
                // Arrange
                const long BUSINESS_ID = 1;

                var chargeDto = new ChargeDto
                    {
                        Name = "Whiskey",
                        ChargeCategory = new ChargeCategoryDto
                            {
                                BusinessId = BUSINESS_ID,
                                Name = "Bar"
                            },
                        ChargeType = new ChargeTypeDto { Type = ChargeTypeEnumDto.Charge },
                        ChargeCostType = new ChargeCostTypeDto { Type = ChargeCostTypeEnumDto.Variable }
                    };

                // Stub the BusinessCache to be used by our service method
                CacheHelper.StubBusinessCacheSingleBusiness(BUSINESS_ID);

                var settingsManager = MockRepository.GenerateMock<ISettingsManager>();
                PropertyManagementSystemService.SettingsManager = settingsManager;

                settingsManager.Expect(r => r.ModifyCharge(Arg<Charge>.Is.Anything, Arg<bool>.Is.Anything)).Repeat.Once();

                // Act
                PropertyManagementSystemService.ModifyCharge(chargeDto);

                // Assert
                settingsManager.VerifyAllExpectations();
            }
        public void ModifyCharge(ChargeDto chargeDto)
        {
            long businessId = chargeDto.ChargeCategory.BusinessId;

            // Make sure the current user has access to this business
            CheckAccessRights(businessId);

            if (Cache.Business.TryGetValue(businessId) == null)
            {
                throw new ValidationException(ErrorFactory.CreateAndLogError(Errors.SRVEX30001, "PropertyManagementSystemService.GetGlCodesByBusinessId",
                    additionalDescriptionParameters: (new object[] { businessId })));
            }

            Charge charge = Mapper.Map<Charge>(chargeDto);
            charge.IsActive = true;

            settingsManager.ModifyCharge(charge);
        }