diff --git a/src/main/java/com/serenitydojo/Dog.java b/src/main/java/com/serenitydojo/Dog.java new file mode 100644 index 0000000..5ff0871 --- /dev/null +++ b/src/main/java/com/serenitydojo/Dog.java @@ -0,0 +1,30 @@ +package com.serenitydojo; + +public class Dog { + public String name; + public String toy; + public int age; + + // consturctor method + public Dog(String name, String toy, int age) { + this.name = name; + this.toy = toy; + this.age = age; + } +//Get Method + public String getName() { + return name; + } + + public String getFavoriteToy() { + return toy; + } + + public int getAge() { + return age; + } +} + + + + diff --git a/src/test/java/com/serenitydojo/WhenCreatingObjects.java b/src/test/java/com/serenitydojo/WhenCreatingObjects.java index d95e186..ab8ce1b 100644 --- a/src/test/java/com/serenitydojo/WhenCreatingObjects.java +++ b/src/test/java/com/serenitydojo/WhenCreatingObjects.java @@ -4,4 +4,11 @@ import org.junit.Test; public class WhenCreatingObjects { + @Test + public void creating_a_dog() { + Dog fido = new Dog("Fido","Bone", 5); + Assert.assertEquals(fido.getName(), "Fido"); + Assert.assertEquals(fido.getFavoriteToy(), "Bone"); + Assert.assertEquals(fido.getAge(), 5); + } }