Esempio n. 1
0
        public void TestStp()
        {
            string value1   = _settings.GetValue <string>("test1");
            string value2   = _settings.GetValue <string>("test2");
            int    valueInt = _settings.GetValue <int>("testint");

            Assert.AreEqual(value1, "value1", "Values don't match");
            Assert.AreEqual(value2, "value2", "Values don't match");
            Assert.AreEqual(valueInt, 123, "Values don't match");
        }
        public decimal Calculate(decimal amount, ITaxSettings settings)
        {
            //we expect a 'flat_amount', 'limit_amount', 'under_limit_rate'
            var flatAmount     = settings.GetValue <decimal>("flat_amount");
            var limitAmount    = settings.GetValue <decimal>("limit_amount");
            var underLimitRate = settings.GetValue <decimal>("under_limit_rate");

            if (amount < limitAmount)
            {
                return(amount * underLimitRate);
            }
            return(flatAmount);
        }
Esempio n. 3
0
        public decimal Calculate(decimal amount, ITaxSettings settings)
        {
            //we expect a 'rate'
            var rate = settings.GetValue <decimal>("rate");

            return(amount * rate);
        }