diff --git a/test/fr/devinsy/xidyn/presenters/DomPresenterTest.java b/test/fr/devinsy/xidyn/presenters/DomPresenterTest.java new file mode 100644 index 0000000..8358f00 --- /dev/null +++ b/test/fr/devinsy/xidyn/presenters/DomPresenterTest.java @@ -0,0 +1,97 @@ +package fr.devinsy.xidyn.presenters; + +import org.apache.log4j.BasicConfigurator; +import org.apache.log4j.Level; +import org.apache.log4j.Logger; +import org.fest.assertions.Assertions; +import org.junit.Before; +import org.junit.Test; + +import fr.devinsy.xidyn.data.TagDataManager; + +/** + * + */ +public class DomPresenterTest +{ + /** + * + */ + @Before + public void before() + { + BasicConfigurator.configure(); + Logger.getRootLogger().setLevel(Level.ERROR); + } + + /** + * @throws Exception + * + */ + @Test + public void testDynamize01() throws Exception + { + String source = "aaaaahellozzzzz"; + + String target = new StringPresenter(source).dynamize().toString(); + + Assertions.assertThat(target).isEqualTo(source); + } + + /** + * @throws Exception + * + */ + @Test + public void testDynamize02() throws Exception + { + String source = "aaaaahellozzzzz"; + + String target = new StringPresenter(source).dynamize(null).toString(); + + Assertions.assertThat(target).isEqualTo(source); + } + + /** + * @throws Exception + * + */ + @Test + public void testDynamize03() throws Exception + { + String source = "aaaaahellozzzzz"; + + String target = new StringPresenter(source).dynamize(new TagDataManager()).toString(); + + Assertions.assertThat(target).isEqualTo(source); + } + + /** + * @throws Exception + * + */ + @Test + public void testStaticDynamize01() throws Exception + { + String source = "aaaaahellozzzzz"; + + String target = StringPresenter.dynamize(source, null).toString(); + + Assertions.assertThat(target).isEqualTo(source); + } + + /** + * @throws Exception + * + */ + @Test + public void testStaticDynamize02() throws Exception + { + String source = "aaaaahellozzzzz"; + + String target = StringPresenter.dynamize(source, new TagDataManager()).toString(); + + Assertions.assertThat(target).isEqualTo(source); + } + +} diff --git a/test/fr/devinsy/xidyn/presenters/StringPresenterTest.java b/test/fr/devinsy/xidyn/presenters/StringPresenterTest.java new file mode 100644 index 0000000..39b76d0 --- /dev/null +++ b/test/fr/devinsy/xidyn/presenters/StringPresenterTest.java @@ -0,0 +1,97 @@ +package fr.devinsy.xidyn.presenters; + +import org.apache.log4j.BasicConfigurator; +import org.apache.log4j.Level; +import org.apache.log4j.Logger; +import org.fest.assertions.Assertions; +import org.junit.Before; +import org.junit.Test; + +import fr.devinsy.xidyn.data.TagDataManager; + +/** + * + */ +public class StringPresenterTest +{ + /** + * + */ + @Before + public void before() + { + BasicConfigurator.configure(); + Logger.getRootLogger().setLevel(Level.ERROR); + } + + /** + * @throws Exception + * + */ + @Test + public void testDynamize01() throws Exception + { + String source = "aaaaahellozzzzz"; + + String target = new StringPresenter(source).dynamize().toString(); + + Assertions.assertThat(target).isEqualTo(source); + } + + /** + * @throws Exception + * + */ + @Test + public void testDynamize02() throws Exception + { + String source = "aaaaahellozzzzz"; + + String target = new StringPresenter(source).dynamize(null).toString(); + + Assertions.assertThat(target).isEqualTo(source); + } + + /** + * @throws Exception + * + */ + @Test + public void testDynamize03() throws Exception + { + String source = "aaaaahellozzzzz"; + + String target = new StringPresenter(source).dynamize(new TagDataManager()).toString(); + + Assertions.assertThat(target).isEqualTo(source); + } + + /** + * @throws Exception + * + */ + @Test + public void testStaticDynamize01() throws Exception + { + String source = "aaaaahellozzzzz"; + + String target = StringPresenter.dynamize(source, null).toString(); + + Assertions.assertThat(target).isEqualTo(source); + } + + /** + * @throws Exception + * + */ + @Test + public void testStaticDynamize02() throws Exception + { + String source = "aaaaahellozzzzz"; + + String target = StringPresenter.dynamize(source, new TagDataManager()).toString(); + + Assertions.assertThat(target).isEqualTo(source); + } + +}