Ejemplo n.º 1
0
        public void CalculateProfit()
        {
            IAccountingCalculator calc = new AccountingCalculator();
            decimal net = calc.CalculateNet(1000m, 1000m);

            Assert.AreEqual(1000000m, net);
        }
Ejemplo n.º 2
0
        protected void btnDisplayTotals_Click(object sender, EventArgs e)
        {
            try
            {
                decimal revenue = decimal.Parse(txtRevenue.Text);
                decimal expenses = decimal.Parse(txtExpenses.Text);

                IAccountingCalculator calculator = new AccountingCalculator();
                decimal net = calculator.CalculateNet(revenue, expenses);

                litNet.Text = net.ToString("C");
                pnlError.Visible = false;
            }
            catch
            {
                pnlError.Visible = true;
            }
        }
Ejemplo n.º 3
0
 public void NegativeRevenue()
 {
     IAccountingCalculator calc = new AccountingCalculator();
     decimal net = calc.CalculateNet(-1000m, 1000m);
 }
Ejemplo n.º 4
0
 public void NegativeExpenses()
 {
     IAccountingCalculator calc = new AccountingCalculator();
     decimal net = calc.CalculateNet(1000m, -1000m);
 }