package jp.sourceforge.cfneo.at4ie2.api.test.impl.invoker;

import jp.sourceforge.cfneo.at4ie2.api.test.AbstractInvoker;
import jp.sourceforge.cfneo.at4ie2.api.test.BTAssertException;
import jp.sourceforge.cfneo.at4ie2.api.test.Context;
import jp.sourceforge.cfneo.at4ie2.api.test.TestCase;

public class AssertTitleInvoker extends AbstractInvoker {

	public AssertTitleInvoker(Context context) {
		super(context);
	}

	@Override
	public void invoke(TestCase testCase) {
		String expected = testCase.getTarget().getTargetStream().trim();
		String actual = this.getBrowser().getTitle();
		if (expected.equals(actual) == false) {
			throw new BTAssertException(expected, actual);
		}
	}

}
