Пример #1
0
        public void GiftAidSupplementForRunningEvent()
        {
            decimal baseAmount         = GiftAidCalculator.GiftAidFor(100);
            decimal supplementedAmount = GiftAidCalculator.GiftAidFor(100, runEvent);

            Assert.AreEqual(baseAmount * 1.05m, supplementedAmount);
        }
Пример #2
0
        public void RoundedGiftAidCalculation()
        {
            decimal exactDonation  = 1.23456m;
            decimal roundedGiftAid = 0.31m;

            Assert.AreEqual(roundedGiftAid, GiftAidCalculator.GiftAidFor(exactDonation));
        }
Пример #3
0
        public void SimpleGiftAidCalculation()
        {
            decimal expectedAmount   = 25.0m;
            decimal calculatedAmount = GiftAidCalculator.GiftAidFor(100);

            Assert.AreEqual(expectedAmount, calculatedAmount);
        }
Пример #4
0
        public void UpdatingTaxRateAsAdmin()
        {
            decimal newTaxRate = 30.0m;

            GiftAidCalculator.UpdateTaxRate(newTaxRate, admin);

            Assert.AreEqual(newTaxRate, GiftAidCalculator.TaxRate);
        }
Пример #5
0
        public void UpdatingTaxRateAsUser()
        {
            decimal newTaxRate = 35.0m;
            decimal oldTaxRate = 30.0m;

            GiftAidCalculator.UpdateTaxRate(newTaxRate, user);

            Assert.AreEqual(oldTaxRate, GiftAidCalculator.TaxRate);
        }
Пример #6
0
		static void UpdateTaxRateAsAdmin()
		{
			Admin jg = new Admin();
			decimal newTaxRate;

			Console.WriteLine("Please Enter the new tax rate in %:");
			newTaxRate = decimal.Parse(Console.ReadLine());
			GiftAidCalculator.UpdateTaxRate(newTaxRate, jg);
			Console.WriteLine("Tax rate updated to: {0}", newTaxRate);
		}
Пример #7
0
		static void CalculateGiftAid()
		{
			decimal donation;
			Event varEvent;

			Console.WriteLine("Please Enter donation amount:");
			donation = decimal.Parse(Console.ReadLine());
			Console.WriteLine("Please Enter and event type e.g running:");
			varEvent = new Event(Console.ReadLine());
			
			Console.WriteLine("Gift Aid Amount: {0}", 
					GiftAidCalculator.GiftAidFor(donation, varEvent));
			Console.WriteLine("Press any key to continue.");
			Console.ReadLine();
		}