ChatTest.java
01 package fr.isae.chat.model;
02 
03 import org.junit.*;
04 import static org.junit.Assert.*;
05 
06 /**
07  *  Unit Test for class Chat.
08  *
09  *
10  * Created: Sun Jan 29 22:10:29 2006
11  *
12  @author <a href="mailto:garion@isae.fr">Christophe Garion</a>
13  @version 1.0
14  */
15 public class ChatTest {
16 
17     private Chat c;
18 
19     /**
20      * Setup for the tests.
21      */
22     @Before public void setUp() {
23         c = new Chat();
24         c.ajouter("Toto""Coucou");
25         c.ajouter("Titi""Blabla");
26         c.ajouter("Toto""Meuh");
27     }
28 
29     /**
30      * Simple test method for getDerniereEntree.
31      */
32     @Test public void testGetDerniereEntree() {
33         assertSame("Toto", c.getDerniereEntree().getNom());
34         assertSame("Meuh", c.getDerniereEntree().getTexte());
35     }
36 
37     /**
38      * Simple test method for ajouter.
39      */
40     @Test public void testAjouter() {
41         c.ajouter("Titi""Cuicui");
42         assertSame("Titi", c.getDerniereEntree().getNom());
43         assertSame("Cuicui", c.getDerniereEntree().getTexte());
44     }
45 }