Exemplo n.º 1
0
        public void SetTaxCalculator(int customerId)
        {
            // TODO: SetCustomerTaxCalculator would reach out to a service which grabs the appropriate TaxCalculator to be used
            var taxCalculator = new TaxCalculator(); // replace new TaxCalculator() with the one from the above TODO service

            _taxCalculatorService = new TaxCalculatorService(taxCalculator, _logger);
        }
Exemplo n.º 2
0
 public Engine(ITaxCalculatorService taxCalculatorService, IReader reader, IWriter writer, IInputValidator inputValidator)
 {
     this.taxCalculatorService = taxCalculatorService;
     this.reader         = reader;
     this.writer         = writer;
     this.inputValidator = inputValidator;
 }
 public MonthlyReporterService()
 {
     this.domesticCalculator = IoCWrapper.Get<ITaxCalculatorService>("Domestic");
     this.internationalTaxCalculator = IoCWrapper.Get<ITaxCalculatorService>("International");
     this.Header = "Month | Total Invoice Amount | ST | EC | FRT";
     this.rolledUpInvoices = new Dictionary<string, Taxes>();
 }
Exemplo n.º 4
0
 public OrderTaxController(ILogger <TaxRateController> logger, IMapper mapper, ITaxCalculatorService service, IOptions <AppSettings> appSettings)
 {
     _logger = logger;
     _mapper = mapper;
     _taxCalculatorService = service;
     _appSettings          = appSettings.Value;
 }
Exemplo n.º 5
0
 public void Initialize()
 {
     _mockRepository          = new MockRepository(MockBehavior.Strict);
     _mockIncomeTaxRepository = _mockRepository.Create <IIncomeTaxRepository>();
     _mockIncomeTaxRepository.Setup(x => x.CreateIncomeTax(It.IsAny <IncomeTax>())).Returns(new IncomeTax());
     _taxCalculatorService = new TaxCalculatorService(_mockIncomeTaxRepository.Object);
     _controller           = new IncomeTaxController(_taxCalculatorService);
 }
Exemplo n.º 6
0
        public void TestInitialize()
        {
            _mockTaxableType      = new Mock <ITaxableType>(MockBehavior.Strict);
            _mockTaxSpecification = new Mock <ISpecification <Product> >(MockBehavior.Strict);
            _mockTaxSpecification.As <ITaxableType>();
            _mockCountryDefinitionService = new Mock <ICountryDefinitionDataAccess>(MockBehavior.Strict);
            _mockSpecifications           = new Mock <IEnumerable <ISpecification <Product> > >(MockBehavior.Strict);
            _mockSpecifications.Setup(c => c.GetEnumerator()).Returns(new List <ISpecification <Product> > {
                _mockTaxSpecification.Object
            }.Select(x => x).GetEnumerator());

            _taxCalculatorService = new TaxCalculatorService(_mockCountryDefinitionService.Object, _mockSpecifications.Object);
        }
Exemplo n.º 7
0
        public static ITaxCalculatorService GetTaxCalculatorService(TaxType taxType)
        {
            ITaxCalculatorService taxCalculatorService = null;

            switch (taxType)
            {
            case TaxType.FlatTaxRate:
                taxCalculatorService = new FlatRateTaxCalculatorService();
                break;

            case TaxType.FlatValue:
                taxCalculatorService = new FlatValueTaxCalculatorService();
                break;

            case TaxType.Progressive:
                taxCalculatorService = new ProgressiveTaxCalculatorService();
                break;

            default:
                throw new ApplicationException(string.Format("The tax type '{0}' supplied is not supported.", taxType.ToString()));
            }

            return(taxCalculatorService);
        }
Exemplo n.º 8
0
 public PayrollService(ITaxCalculatorService taxCalculatorService)
 {
     _taxCalculatorService = taxCalculatorService;
 }
Exemplo n.º 9
0
 public RatesController(
     ITaxCalculatorService taxRateService
     )
 {
     _taxRateService = taxRateService;
 }
Exemplo n.º 10
0
 public PaySlipService(IRoundingService roundingService, ITaxCalculatorService taxCalculatorService)
 {
     _roundingService      = roundingService;
     _taxCalculatorService = taxCalculatorService;
 }
Exemplo n.º 11
0
 /// <summary>
 /// Constructor to create a new <see cref="TaxController"/>.
 /// </summary>
 /// <param name="taxService">The <see cref="ITaxService"/> used to retrieve the tax regions.</param>
 /// <param name="taxCalculatorService">The <see cref="ITaxCalculatorService"/> used to calculate taxes.</param>
 /// <param name="taxInputUtility">The <see cref="ITaxInputUtility"/> used to validate inputs.</param>
 public TaxController(ITaxService taxService, ITaxCalculatorService taxCalculatorService, ITaxInputUtility taxInputUtility)
 {
     _taxService           = taxService;
     _taxCalculatorService = taxCalculatorService;
     _taxInputUtility      = taxInputUtility;
 }
Exemplo n.º 12
0
 /// <summary>
 /// Constructor method
 /// </summary>
 /// <param name="employeeService">instance of employee service</param>
 /// <param name="taxCalculatorService">instance of tax calculator service</param>
 public EmployeeViewModel(IEmployeeService employeeService, ITaxCalculatorService taxCalculatorService)
 {
     this._employeeService      = employeeService;
     this._taxCalculatorService = taxCalculatorService;
 }
Exemplo n.º 13
0
 public PaySlipService(ITaxCalculatorService taxCalculatorService)
 {
     _taxCalculatorService = taxCalculatorService;
 }
Exemplo n.º 14
0
 public TaxController(ITaxTypeService taxTypeService, ITaxCalculatorService taxCalculatorService, IMediator mediator)
 {
     _taxTypeService       = taxTypeService;
     _taxCalculatorService = taxCalculatorService;
     Mediator = mediator;
 }
Exemplo n.º 15
0
 public TaxCalculatorController(ITaxCalculatorService taxCalculatorService)
 {
     _taxCalculatorService = taxCalculatorService;
 }
 public void TestInitialize()
 {
     _taxCalculator = new TaxCalculatorService();
     _settings      = TaxBracketConfigSection.LoadSettings();
 }
Exemplo n.º 17
0
 public TaxCalculatorService(ITaxCalculatorService taxCalculatorClient)
 {
     clientClass = taxCalculatorClient;
 }
Exemplo n.º 18
0
 public TaxController(ITaxCalculatorService taxCalculatorService, ITaxBracketService taxBracketService)
 {
     _taxCalculatorService = taxCalculatorService;
     _taxBracketService    = taxBracketService;
 }
Exemplo n.º 19
0
 public App(ITaxCalculatorService taxCalculatorService, ILogger logger)
 {
     _taxCalculatorService = taxCalculatorService;
     this.Logger           = logger;
 }
Exemplo n.º 20
0
 public PayrollFileService(IOptions <AppSettings> appSettingsOptions, ITaxCalculatorService taxCalculatorService)
 {
     _appSettingsOptions   = appSettingsOptions;
     _taxCalculatorService = taxCalculatorService;
 }
Exemplo n.º 21
0
 public IncomeTaxController(ITaxCalculatorService taxCalculatorService)
 {
     _taxCalculatorService = taxCalculatorService;
 }
Exemplo n.º 22
0
 public CartService(ITaxCalculatorService taxCalculatorDataAccess, ICountryDefinitionDataAccess countryDefinitionDataAccess, ICartItemDataAccess cartItemDataAccess)
 {
     _taxCalculatorDataAccess     = taxCalculatorDataAccess;
     _countryDefinitionDataAccess = countryDefinitionDataAccess;
     _cartItemDataAccess          = cartItemDataAccess;
 }
Exemplo n.º 23
0
 public PayslipService(ITaxCalculatorService taxCalculator)
 {
     _taxCalculator = taxCalculator;
 }