I have an assignment where I am to test a class I've written by writing another class called Tester. Tester can have no instance variables or methods, everything has to be done in one constructor.
If I need to share the main class I will, but I'd rather just try to describe my issue so I can get the methodology, and try to figure out what to do on my own.
Here's the two methods of interest that I am trying to test:
public void setTime(int hour, int minute) { hours.setValue(hour); minutes.setValue(minute); updateDisplay(); updateDisplayUS(); } public String getUSTime() { return displayStringUS; }
What Tester needs to do is print out what is stored in displayStringUS to check it against the time I have entered into clock.setTime() in my Tester class:
public Tester() { ClockDisplay clock = new ClockDisplay(); clock.setTime(00, 00); clock.getUSTime(); System.out.println(*****); }
In a nutshell, I'm trying to test what is entered in clock.setTime manually against what the code from the ClockDisplay class generates. I need to do this for 8 separate time tests.
I have no idea how to do this. I've Googled for an hour now, but I guess I just simply lack the vocabulary at this point to search for the proper syntax.