/*
 *  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.games.whouse;

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

/**
 * @author <a href="mailto:shabanovd@gmail.com">Dmitriy Shabanov</a>
 *
 */
public class DocumentTest extends ATest {

	@Test
	public void test() throws Exception {
		
		testAnimo("the user1 have name \"user1\".");
		testAnimo("the user2 have name \"user1\".");

		testAnimo("the number have name \"number\".");
		testAnimo("the date have name \"date\".");
		testAnimo("the owner have name \"owner\".");

		testAnimo("the document (have date) (have number) (have owner).");
		
		testAnimo("the doc3 (is document) (have date D \"2011-11-01\") (have number N D 3) (have owner an user1).");
		testAnimo("the doc5 (is document) (have date D \"2011-11-02\") (have number N D 5) (have owner an user1).");
		testAnimo("the doc7 (is document) (have date D \"2011-11-03\") (have number N D 7) (have owner an user2).");
		
		testAnimo("the table (have column) (have row) (ic html \table (\tr each (get colum) (\th get name)) (each (get row) (\tr each (get colum) (\td get name) )).");
		
		testAnimo("the journal (is table) (have column (an date) (an number)) (have row all document).");
		
		testAnimoResult("get html an journal", 
			"<table>" +
				"<tr>" +
					"<th>date</th>" +
					"<th>number</th>" +
				"</tr>" +
				"<tr>" +
					"<td>2011-11-01</td>" +
					"<td>3</td>" +
				"</tr>" +
				"<tr>" +
					"<td>2011-11-02</td>" +
					"<td>5</td>" +
				"</tr>" +
				"<tr>" +
					"<td>2011-11-03</td>" +
					"<td>7</td>" +
				"</tr>" +
			"</table>");
	}
}

@@ -1761,16 +1761,17 @@
 ic html 
+%5C
 %5Ctable (
@@ -1771,16 +1771,17 @@
 table (%5C
+%5C
 tr each 
@@ -1794,16 +1794,17 @@
 olum) (%5C
+%5C
 th get n
@@ -1827,16 +1827,17 @@
  row) (%5C
+%5C
 tr each 
@@ -1850,16 +1850,17 @@
 olum) (%5C
+%5C
 td get n

fix a typo