Ejemplo n.º 1
0
        public static decimal CalculateStampDuty(StampDutyRate stampDutyRate, decimal amount)
        {
            var duty = MultipleCount(stampDutyRate.ForEvery, amount) * stampDutyRate.Amount +
                       Modulus(stampDutyRate.ForEvery, amount) * stampDutyRate.Amount;

            return(Math.Min(duty, stampDutyRate.MaxAmount));
        }
Ejemplo n.º 2
0
 public Calculator(BrokerageFeeRate brokerageFeeRate, ClearingFeeRate clearingFeeRate,
                   StampDutyRate stampDutyRate, SalesServiceTaxRate taxRate)
 {
     this.brokerageFeeRate = brokerageFeeRate;
     this.clearingFeeRate  = clearingFeeRate;
     this.stampDutyRate    = stampDutyRate;
     this.taxRate          = taxRate;
 }
Ejemplo n.º 3
0
        public void CalculateStampDuty_with_500_returns_expected_result(StampDutyRate stampDutyRate)
        {
            var sut = new Func <StampDutyRate, decimal, decimal>(StampDutyExtensions.CalculateStampDuty);

            var result = sut(stampDutyRate, 500);

            result.Should().Be(1);
        }
Ejemplo n.º 4
0
        public void Calculate_returns_expected_result(BrokerageFeeRate brokerageFeeRate,
                                                      ClearingFeeRate clearingFeeRate,
                                                      StampDutyRate stampDutyRate, SalesServiceTaxRate salesServiceTaxRate)
        {
            var sut = new Calculator(brokerageFeeRate, clearingFeeRate, stampDutyRate, salesServiceTaxRate);

            var result = sut.Calculate(1, Lot(1), 1.5m);

            result.Profit.Should().Be(50);
        }
Ejemplo n.º 5
0
 public static Fee Fee(BrokerageFeeRate brokerageFeeRate, ClearingFeeRate clearingFeeRate, StampDutyRate stampDutyRate,
                       SalesServiceTaxRate salesServiceTaxRate) =>
 new Fee(brokerageFeeRate, clearingFeeRate, stampDutyRate, salesServiceTaxRate);