I Need The Unit Tests Written

Need help with similar Computer Science questions?

Ask A Question

Question: I Need The Unit Tests Written

Asked
Modified
Viewed 47

This assignment requires you to write unit tests, described as follows:


 1. eCash java class is provided for this assignment,

 2. Specify class invariants, and preconditions & postconditions of the method of the class, and

 3. Develop unit tests for the eCash java class to check the method with the specified conditions. You can use any unit test framework (jUnit, cppUnit, nUnit, unittest, ...), depending on the implementation language you used for your classes




Submit a zipped file containing the following:


   source codes of your unit tests

   a brief description of how you designed unit tests, along with how to run your test and screen shots showing the results of each test

More Instructions
package app; import java.util.Arrays; import java.util.Collections; public class eCash { static String CustomerID = "110110"; static String Message = "BankOfAmerica"; /* * Precondition : @Val, @uniqueID should not be null * Postcondition : return string as "@uniqueID, @value, @Message" */ public static String createOrder(String Val) { String MOrder = new String(); Integer[] arr = new Integer[1000]; for (int i = 0; i < arr.length; i++) { arr[i] = i; } Collections.shuffle(Arrays.asList(arr)); String uniqueID = ""; for(int i = 0; i < arr.length; i++){ uniqueID = arr[i].toString(); MOrder = uniqueID + "," + Val + "," + Message; } return MOrder; } }
Answers 0

No answers posted

Post your Answer - free or at a fee

Login to your tutor account to post an answer

Posting a free answer earns you +20 points.

Login

Ask a question for free and get answers to get Computer Science assignment help with a similar task to this question.