Question: I need help with the following: Create a JUnit Test class inside of a NetBeans project for the Time1 class (test class is Time1Test). The
I need help with the following:
Create a JUnit Test class inside of a NetBeans project for the "Time1" class (test class is "Time1Test"). The test class must contain a test method, "evaluateSetTime" (annotation "@Test" must be used on preceding line) that performs the following.
Creates a "Time1" object. (Arrange - create instance & setup starting conditions)
Invokes the "setTime" method passing the following arguments for the formal parameters (Act - execute code needing verification)
hour - 1
minute - 25
second - 13
Set "expectedTime" string variable to "01:25:13".
Invokes "toUniversalString" method storing the result in string variable "actualTime".
Invokes the "assertEquals" method passing following arguments for the formal parameters (Assert - whatever the expected results should be)
message - "expected and actual time are not equal"
expected - expectedTime
actual - actualTime
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
