/*
 *  Copyright (C) 2011 The Animo Project
 *  http://animotron.org
 *
 *  This program is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU Lesser General Public License
 *  as published by the Free Software Foundation; either version 3
 *  of the License, or (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU Lesser General Public License for more details.
 *
 *  You should have received a copy of the GNU Lesser General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
package org.animotron.statement.animo.update;

import org.animotron.ATest;
import org.animotron.expression.AnimoExpression;
import org.junit.Test;

/**
 * @author <a href="mailto:gazdovsky@gmail.com">Evgeny Gazdovsky</a>
 *
 */
public class UpdateTest extends ATest {

    @Test
	public void test_00() throws Exception {
        testAnimo("the a have x 1.");
        eval(new AnimoExpression("add a have y 2."));
        testAnimo("a", "the a (have x 1) (have y 2).");
	}

    @Test
	public void test_01() throws Exception {
        testAnimo("the a have x 1.");
        eval(new AnimoExpression("replace (get x a) (have y 2)."));
        testAnimo("a", "the a have y 2.");
	}


}
@@ -922,16 +922,60 @@
 ession;%0A
+import org.animotron.expression.Expression;%0A
 import o
@@ -1167,33 +1167,58 @@
 n %7B%0A        
-testAnimo
+Expression e = new AnimoExpression
 (%22the a have
@@ -1284,37 +1284,37 @@
 ));%0A        
-tes
+asser
 tAnimo(
-%22a%22
+e
 , %22the a (ha
@@ -1400,25 +1400,50 @@
         
-testAnimo
+Expression e = new AnimoExpression
 (%22the a 
@@ -1535,21 +1535,240 @@
     
-testAnimo(%22a%22
+assertAnimo(e, %22the a have y 2.%22);%0A%09%7D%0A%0A    @Test%0A%09public void test_02() throws Exception %7B%0A        Expression e = new AnimoExpression(%22the a have x 1.%22);%0A        eval(new AnimoExpression(%22set (get x a) (2).%22));%0A        assertAnimo(e
 , %22t
@@ -1769,30 +1769,30 @@
 (e, %22the a have 
-y
+x
  2.%22);%0A%09%7D%0A%0A%0A%7D
@@ -1789,10 +1789,9 @@
 %22);%0A%09%7D%0A%0A
-%0A
 %7D

fix tests