Package urban.model

Source Code of urban.model.ObservationTest

package urban.model;

import static org.junit.Assert.*;

import java.util.Collection;
import java.util.List;

import org.antlr.runtime.RecognitionException;
import org.junit.Test;

import urban.parser.UrbanParser;

public class ObservationTest {

  @Test
  public void testToString() throws RecognitionException {
    assertEquals("%obs: 'Foo' A(f)\n", new Observation("Foo", getAgentList("A(f)")).toString());
  }

  private List<Agent> getAgentList(String string) throws RecognitionException {
    return new UrbanParser(string).expression();
  }

  @Test
  public void testGetSites() throws RecognitionException {
    Collection<Site> sites = new Observation("Foo", getAgentList("A(f)")).getSites();
    assertTrue(sites.contains(new Site("A","f",null,null)));
  }

}
TOP

Related Classes of urban.model.ObservationTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.