123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- import static org.junit.Assert.*;
- import org.junit.After;
- import org.junit.Before;
- import org.junit.Test;
- import org.junit.Assert;
-
- public class MainApplicationTest
- {
-
- MainApplication main = new MainApplication();
- Pet petCaller = new Pet();
-
- @Test
- public void testSpeakDog(){
- //when
- petCaller.setTypes("Dog");
- petCaller.setName("Sparky");
- petCaller.setSpeak("Woof");
-
- //expected
- String expected = "Dog : Sparky says: Woof";
-
- //actual
- String actual = main.
-
- Assert.assertEquals(expected, actual);
- }
-
- @Test2
- public void testSpeakFish(){
- //when
- petCaller.setTypes("Fish");
- petCaller.setName("Zach");
- petCaller.setSpeak("...");
-
- //expected
- String expected = "Fish : Zach says: ...";
-
- //actual
- String actual = main.
-
- Assert.assertEquals(expected, actual);
- }
- }
|