001    package aima.test.tvenvironmenttest;
002    
003    import junit.framework.TestCase;
004    import aima.basic.vaccum.ModelBasedTVEVaccumAgent;
005    import aima.basic.vaccum.TrivialVaccumEnvironment;
006    
007    /**
008     * @author Ravi Mohan
009     * 
010     */
011    public class TrivialVaccumEnvironmentTest extends TestCase {
012            TrivialVaccumEnvironment tve, tve2, tve3, tve4;
013    
014            ModelBasedTVEVaccumAgent a;
015    
016            public TrivialVaccumEnvironmentTest(String name) {
017                    super(name);
018            }
019    
020            @Override
021            public void setUp() {
022                    tve = new TrivialVaccumEnvironment("Dirty", "Dirty");
023                    tve2 = new TrivialVaccumEnvironment("Clean", "Clean");
024                    tve3 = new TrivialVaccumEnvironment("Clean", "Dirty");
025                    tve4 = new TrivialVaccumEnvironment("Dirty", "Clean");
026                    a = new ModelBasedTVEVaccumAgent();
027            }
028    
029            public void testTVEConstruction() {
030                    assertEquals("Dirty", tve.getLocation1Status());
031                    assertEquals("Dirty", tve.getLocation2Status());
032                    assertEquals("Clean", tve2.getLocation1Status());
033                    assertEquals("Clean", tve2.getLocation2Status());
034            }
035    
036            public void testAgentAdd() {
037                    tve.addAgent(a, "A");
038                    assertEquals("A", tve.getAgentLocation(a));
039                    assertEquals(1, tve.getAgents().size());
040    
041            }
042    
043    }