/// <summary> /// Adds one dollar amound to another dollar amount /// </summary> /// <param name="amountToAdd"></param> /// <returns>New Dollar Amount Value</returns> public DollarAmount Plus(DollarAmount amountToAdd) { int newTotal = this.totalAmountInCents + amountToAdd.totalAmountInCents; return(new DollarAmount(newTotal)); }
/// <summary> /// Subtract one dollar amount from another dollar amount /// </summary> /// <param name="amountToSubtract"></param> /// <returns>New Dollar Amount Value</returns> public DollarAmount Minus(DollarAmount amountToSubtract) { int difference = this.totalAmountInCents - amountToSubtract.totalAmountInCents; return(new DollarAmount(difference)); }