package model;

import java.awt.Point;

import pbl2011.model.ClassModel;

import junit.framework.TestCase;
import junitx.util.PrivateAccessor;

public class ClassModelTest extends TestCase {

	 ClassModel _target;

	protected void setUp() throws Exception {
		// TODO 自動生成されたメソッド・スタブ
		super.setUp();


	}

	@Override
	protected void tearDown() throws Exception {
		// TODO 自動生成されたメソッド・スタブ
		super.tearDown();

	}



	public void testClassModel001() throws Throwable {

		String str = "CLASS	1	注文	public	10	20	30	70	40	100";
		_target = new ClassModel(str);

		assertEquals(Integer.valueOf(1),(Integer)PrivateAccessor.getField(_target, "classId"));
		assertEquals(Boolean.FALSE,PrivateAccessor.getField(_target, "delFlag"));
		assertEquals("注文",(String)PrivateAccessor.getField(_target, "className"));
		assertEquals("public",(String)PrivateAccessor.getField(_target, "visibility"));
		assertEquals(new Point(10,20),(Point)PrivateAccessor.getField(_target, "p"));
		assertEquals(Integer.valueOf(30),(Integer)PrivateAccessor.getField(_target, "height1"));
		assertEquals(Integer.valueOf(70),(Integer)PrivateAccessor.getField(_target, "height2"));
		assertEquals(Integer.valueOf(40),(Integer)PrivateAccessor.getField(_target, "height3"));
		assertEquals(Integer.valueOf(100),(Integer)PrivateAccessor.getField(_target, "width"));
	}

}
