public void CalculateProfit() { IAccountingCalculator calc = new AccountingCalculator(); decimal net = calc.CalculateNet(1000m, 1000m); Assert.AreEqual(1000000m, net); }
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; } }
public void NegativeRevenue() { IAccountingCalculator calc = new AccountingCalculator(); decimal net = calc.CalculateNet(-1000m, 1000m); }
public void NegativeExpenses() { IAccountingCalculator calc = new AccountingCalculator(); decimal net = calc.CalculateNet(1000m, -1000m); }