Question: Unit Testing using JUnit. The test should discover some bugs within the classes youve been given. For example, Strings should not be null or blank,
Unit Testing using JUnit.
The test should discover some bugs within the classes youve been given. For example, Strings should not be null or blank, numbers should not be negative, etc.
**will not be debugging nor fixing the code, only testing the code.**




public class Account extends java. lang. 0 bject Version: 2019.04.20 Author: Bullwinkle Moose Constructor Summary Method Summary Constructor Details Account public Account() Default constructor to create Account objects Account public Account(java. lang.String accountNumber, double balance) Overloaded Account constructor Parameters: accountNumber - to set the accountNumber field balance - to set the balance field Method Details getAccountNumber public java. lang. String getAccountNumber() accessor for the accountNumber field Returns: the accountNumber as a String getBalance public double getBalance() accessor for the balance field Returns: the balance as a double is Active public boolean isActive() accessor for the active field Returns: the active boolean setBalance public void setBalance(double balance) mutator fir the balance field Parameters: balance - the balance to set setActive public void setActive(boolean active) mutator for the active field Parameters: active - the active to set addToBalance public void addToBalance(double amount) Adds to an Account balance Parameters: amount - a double to add to the existing balance field subtractFromBalance public void subtractFromBalance (double amount) Subtracts from an Account balance Parameters: amount - a double to subtract from the balance field toString public java. lang.String tostring() Overrides: toString in class java. lang. Object
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
