Exemplo n.º 1
0
        public TaxLogic(ITaxDataAccess taxDataAccess)
        {
            TaxEventHandler taxEventHandler;
            Key             key;

            _taxDataAccess = taxDataAccess;

            _taxController = new TaxController <Key, TaxEventHandler>();

            //set up tax handlers
            taxEventHandler = new ProgressiveTaxEvent(_taxDataAccess);
            key             = new Key {
                TaxCode = "7441"
            };
            _taxController.AddEventHandler(key, taxEventHandler);

            taxEventHandler = new FlatValueTaxEvent(_taxDataAccess);
            key             = new Key {
                TaxCode = "A100"
            };
            _taxController.AddEventHandler(key, taxEventHandler);

            taxEventHandler = new FlatRateTaxEvent(_taxDataAccess);
            key             = new Key {
                TaxCode = "7000"
            };
            _taxController.AddEventHandler(key, taxEventHandler);

            taxEventHandler = new ProgressiveTaxEvent(_taxDataAccess);
            key             = new Key {
                TaxCode = "1000"
            };
            _taxController.AddEventHandler(key, taxEventHandler);
        }
Exemplo n.º 2
0
 public void Init()
 {
     _taxDataAccess       = new Mock <ITaxDataAccess>();
     _progressiveTaxEvent = new ProgressiveTaxEvent(_taxDataAccess.Object);
     //mock test data
     _taxDataAccess.Setup(x => x.GetProgressiveTaxRates())
     .Returns(new List <Dto.DataAccess.ProgressiveTaxRate>
     {
         new Dto.DataAccess.ProgressiveTaxRate
         {
             ProgressiveTaxRateId = 1,
             Percentage           = 10,
             MinimumAmount        = 0,
             MaximumAmount        = 8350.00m
         },
         new Dto.DataAccess.ProgressiveTaxRate
         {
             ProgressiveTaxRateId = 2,
             Percentage           = 15,
             MinimumAmount        = 8351.00m,
             MaximumAmount        = 33950.00m
         },
         new Dto.DataAccess.ProgressiveTaxRate
         {
             ProgressiveTaxRateId = 3,
             Percentage           = 25,
             MinimumAmount        = 33951.00m,
             MaximumAmount        = 82250.00m
         },
         new Dto.DataAccess.ProgressiveTaxRate
         {
             ProgressiveTaxRateId = 4,
             Percentage           = 28,
             MinimumAmount        = 82251.00m,
             MaximumAmount        = 171550.00m
         },
         new Dto.DataAccess.ProgressiveTaxRate
         {
             ProgressiveTaxRateId = 5,
             Percentage           = 33,
             MinimumAmount        = 171551.00m,
             MaximumAmount        = 372950.00m
         },
         new Dto.DataAccess.ProgressiveTaxRate
         {
             ProgressiveTaxRateId = 6,
             Percentage           = 35,
             MinimumAmount        = 372951.00m,
             MaximumAmount        = (int?)null
         }
     });
 }