-
Notifications
You must be signed in to change notification settings - Fork 64
Expand file tree
/
Copy pathFishTest.java
More file actions
28 lines (25 loc) · 871 Bytes
/
FishTest.java
File metadata and controls
28 lines (25 loc) · 871 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package io.zipcoder;
import org.junit.Assert;
import org.junit.Test;
public class FishTest {
@Test
public void testSpeak() {
// Arrange: create an instance variable (myCat) of the object to act on
Fish myFish = new Fish("Tony");
String expected = "tinkles";
//Act: call method on our object
String actual = myFish.speak();
//Assert: check the outcome on what we expect.
Assert.assertEquals(expected, actual);
}
@Test
public void testGetName() {
// Arrange: create an instance variable (myCat) of the object to act on
Fish myFish = new Fish("Tony");
String expected = "Tony";
//Act: call method on our object
String actual = myFish.getName();
//Assert: check the outcome on what we expect.
Assert.assertEquals(expected, actual);
}
}