A new method has been added to a class and we would like to add some unit tests for this method. This method checks if users have exceed their storage usage.
The method first warns the user when nearing the account limit and then if the user exceeds the limit it changes the status (disables) the account.
The following tests should be completed:
- Check to ensure that the account is NOT warned or the account status is not changed when the storage level has NOT been reached.
- Check that account is warned for FREE accounts only when the limit is reached.
- Check that that account is warned only once by increasing the usage.
- Check that the account status has been changed to disabled when the account exceeds its storage limit.
- Decrease the usage but not by enough to reset the account. Ensure that the account status is still disabled.
- Change the account status back to normal and reduce the storage limit to below the allowed limit and then increase the limit and ensure that the account is warned again.
10 freelanceria on tarjonnut keskimäärin 33$ tähän työhön
Hi, I am certified Java Software Engineer with 3 years of experience from Germany. I did lot of unit tests using mockito, powermock and junit. I also have experience with test driven development.