/*
 *  Draco Econometrics
 *  Copyright (C) 2006-2008 Approximatrix, LLC
 *  http://www.approximatrix.com
 *  
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU 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 General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

package com.approximatrix.draco.io;

import static org.junit.Assert.*;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

public class HTMLImportExportTest {

	private static final String HTML = "<html><body>Should be ignored<br>" +
		"<table><tr><td>integer</td><td>double</td></tr>" +
		"<tr><td>1</td><td>1.0</td></tr>" +
		"<tr><td>2</td><td>2.0</td></tr>" +
		"<tr><td>3</td><td>3.0</td></tr>" +
		"<tr><td>4</td><td>4.0</td></tr>" +
		"</table></body></html>";
	
	private static final String EXPECTED = "integer\tdouble\n" +
		"1\t1.0\n" +
		"2\t2.0\n" +
		"3\t3.0\n" +
		"4\t4.0\n";
	
	@Test
	public void testConvertHTMLToTextTable() {
		String ret = HTMLImportExport.ConvertHTMLToTextTable(HTML);
		
		assertNotNull(ret);
		assertEquals(EXPECTED,ret);
	}

}
