File tree Expand file tree Collapse file tree 2 files changed +47
-0
lines changed
main/java/com/serenitydojo
test/java/com/serenitydojo Expand file tree Collapse file tree 2 files changed +47
-0
lines changed Original file line number Diff line number Diff line change
1
+ package com .serenitydojo ;
2
+
3
+ public class Cat {
4
+ private String name ;
5
+ private String favoriteFood ;
6
+ private int age ;
7
+
8
+ public Cat (String name , String favoriteFood , int age ) {
9
+ this .name = name ;
10
+ this .favoriteFood = favoriteFood ;
11
+ this .age = age ;
12
+ }
13
+
14
+ public String getName () {
15
+ return name ;
16
+ }
17
+
18
+ public void setFavoriteFood (String favoriteFood ) {
19
+ this .favoriteFood = favoriteFood ;
20
+ }
21
+
22
+ public String getFavoriteFood () {
23
+ return favoriteFood ;
24
+ }
25
+
26
+ public int getAge () {
27
+ return age ;
28
+ }
29
+ }
Original file line number Diff line number Diff line change
1
+ package com .serenitydojo ;
2
+
3
+ import org .junit .Assert ;
4
+ import org .junit .Test ;
5
+
6
+ public class WhenCreatingObjects {
7
+
8
+ @ Test
9
+ public void creating_a_cat () {
10
+
11
+ Cat felix = new Cat ("Felix" ,"Tuna" , 4 );
12
+
13
+ assert felix .getName ().equals ("Spot" );
14
+ Assert .assertEquals (felix .getAge (), 5 );
15
+ Assert .assertEquals (felix .getFavoriteFood (), "Tuna" );
16
+ Assert .assertEquals (felix .getAge (), 5 );
17
+ }
18
+ }
You can’t perform that action at this time.
0 commit comments