package test.blog.model;

import static org.junit.Assert.assertEquals;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;

import blog.BLOGUtil;
import blog.model.ArgSpec;
import blog.model.Model;
import blog.type.Timestep;

/**
 * Unit tests for ArgSpec.
 * 
 * @author cberzan
 * @since Jun 4, 2014
 */
@RunWith(JUnit4.class)
public class TestArgSpec {
  @Test
  public void testMaxTimestep() {
    Model model = Model
        .fromString("random Boolean Weather(Timestep t) = true;");
    ArgSpec a = BLOGUtil.parseArgSpec_NE("Weather(@13)", model);
    assertEquals(Timestep.at(13), a.maxTimestep());
  }
}

@@ -167,24 +167,29 @@
 rt blog.
-BLOGUtil
+model.ArgSpec
 ;%0Aimport
@@ -199,32 +199,37 @@
 og.model.ArgSpec
+Query
 ;%0Aimport blog.mo
@@ -239,16 +239,43 @@
 .Model;%0A
+import blog.model.Queries;%0A
 import b
@@ -493,17 +493,8 @@
 odel
-%0A        
 .fro
@@ -506,14 +506,13 @@
 ng(%22
-random
+fixed
  Boo
@@ -555,66 +555,152 @@
     
-ArgSpec a = BLOGUtil.parseArgSpec_NE(%22Weather(@13)%22, model
+Queries queries = new Queries(model);%0A    queries.addFromString(%22query Weather(@13);%22);%0A    ArgSpec a = ((ArgSpecQuery) queries.get(0)).argSpec(
 );%0A 

fix TestArgSpec and inline parseArgSpec_NE, which is about to be removed