Question: The following test class tests a class called Spaceman. class SpacemanTest { private Spaceman testSpaceman; @BeforeEach public void init ( ) { testSpaceman = new

The following test class tests a class called Spaceman.
class SpacemanTest {
private Spaceman testSpaceman;
@BeforeEach
public void init(){
testSpaceman = new Spaceman ("Spacedude",25);
}
@Test
public void ageUpTest(){
testSpaceman.ageUp();
assertEquals(26, testSpaceman.getAge();
}
@Test
public void spacemanSaysTest(){
String spaceText = testSpaceman.spacemanSays("hello world");
assertEquals("Spacedude says: hello world", spaceText);
}
}
How many times are each of the methods of the SpacemanTest class executed when the class is run?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!