package com.alexrnl.commons.translation;

import static org.junit.Assert.fail;

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

/**
 * Test suite for the {@link AbstractDialog} class.
 * @author Alex
 */
public class AbstractDialogTest {
	
	/**
	 * Basic class extending the abstract dialog.
	 * @author Alex
	 */
	private static class HelloDialog extends AbstractDialog {
		/** The key to the translation dialog */
		private final String	helloKey;
		/** Parameters of the dialog */
		private final Object[]	parameters;
		
		/**
		 * Constructor #1.<br />
		 * @param name
		 *        the name to say hello to.
		 */
		public HelloDialog (final String name) {
			super();
			this.helloKey = "commons.dialogs.hello";
			this.parameters = new Object[1];
			parameters[0] = name;
		}
		
		@Override
		public String toString () {
			return helloKey;
		}
		
		@Override
		public Object[] getParameters () {
			return parameters;
		}
		
	}
	
	/**
	 * Set up test attributes.
	 */
	@Before
	public void setUp () {
	}
	
	/**
	 * Test method for {@link com.alexrnl.commons.translation.AbstractDialog#title()}.
	 */
	@Test
	public void testTitle () {
		fail("Not yet implemented"); // TODO
	}
	
	/**
	 * Test method for {@link com.alexrnl.commons.translation.AbstractDialog#message()}.
	 */
	@Test
	public void testMessage () {
		fail("Not yet implemented"); // TODO
	}
	
	/**
	 * Test method for {@link com.alexrnl.commons.translation.AbstractDialog#toString()}.
	 */
	@Test
	public void testToString () {
		fail("Not yet implemented"); // TODO
	}
	
	/**
	 * Test method for {@link com.alexrnl.commons.translation.AbstractDialog#getParameters()}.
	 */
	@Test
	public void testGetParameters () {
		fail("Not yet implemented"); // TODO
	}
}

@@ -66,19 +66,73 @@
 .Assert.
-fai
+assertEquals;%0Aimport static org.junit.Assert.assertNotNul
 l;%0A%0Aimpo
@@ -286,16 +286,72 @@
 gTest %7B%0A
+%09/** The dialog to test */%0A%09private HelloDialog%09dialog;%0A
 %09%0A%09/**%0A%09
@@ -559,167 +559,41 @@
 ;%0A%09%09
-/** Parameters of the dialog */%0A%09%09private final Object%5B%5D%09parameters;%0A%09%09%0A%09%09/**%0A%09%09 * Constructor #1.%3Cbr /%3E%0A%09%09 * @param name%0A%09%09 *        the name to say hello to.
+%0A%09%09/**%0A%09%09 * Constructor #1.%3Cbr /%3E
 %0A%09%09 
@@ -621,25 +621,8 @@
 og (
-final String name
 ) %7B%0A
@@ -681,69 +681,8 @@
 o%22;%0A
-%09%09%09this.parameters = new Object%5B1%5D;%0A%09%09%09parameters%5B0%5D = name;%0A
 %09%09%7D%0A
@@ -757,86 +757,8 @@
 %0A%09%09%0A
-%09%09@Override%0A%09%09public Object%5B%5D getParameters () %7B%0A%09%09%09return parameters;%0A%09%09%7D%0A%09%09%0A
 %09%7D%0A%09
@@ -829,16 +829,46 @@
 Up () %7B%0A
+%09%09dialog = new HelloDialog();%0A
 %09%7D%0A%09%0A%09/*
@@ -999,44 +999,68 @@
 %7B%0A%09%09
-fail(%22Not yet implemented%22); // TODO
+assertEquals(%22commons.dialogs.hello.title%22, dialog.title());
 %0A%09%7D%0A
@@ -1200,44 +1200,72 @@
 %7B%0A%09%09
-fail(%22Not yet implemented%22); // TODO
+assertEquals(%22commons.dialogs.hello.message%22, dialog.message());
 %0A%09%7D%0A
@@ -1407,44 +1407,65 @@
 %7B%0A%09%09
-fail(%22Not yet implemented%22); // TODO
+assertEquals(%22commons.dialogs.hello%22, dialog.toString());
 %0A%09%7D%0A
@@ -1617,44 +1617,96 @@
 %7B%0A%09%09
-fail(%22Not yet imple
+assertNotNull(dialog.getParameters());%0A%09%09assertEquals(0, dialog.getPara
 me
-n
 te
-d%22); // TODO
+rs().length);
 %0A%09%7D%0A

Implement test for the AbstractDialog class