Exemplo n.º 1
0
        public void CreateFlatRate_Returns_FlatRate_BillingRate()
        {
            var flatRate = BillingRate.CreateFlatRate(100);

            Assert.Equal(BillingRate.FlatRateType, flatRate.Name);
            Assert.Equal(100, flatRate.UnitPrice);
            Assert.Equal(flatRate.UnitPrice, flatRate.MinimumCharge);
        }
Exemplo n.º 2
0
        public void SetBillingRate(string name, decimal unitPrice, decimal minimumCharge)
        {
            var billingRate = BillingRate.None;

            switch (name)
            {
            case BillingRate.HourlyType:
                billingRate = BillingRate.CreateHourly(unitPrice, minimumCharge);
                break;

            case BillingRate.FlatRateType:
                billingRate = BillingRate.CreateFlatRate(unitPrice);
                break;
            }

            ValidateBillingRate(billingRate);
            this.BaseBillingRate = billingRate;
        }