Skip to content

Commit

Permalink
update unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lofidewanto committed Oct 17, 2013
1 parent 5045205 commit 825b58f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
package de.crowdcode.kissmda.cartridges.simplejava;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

Expand Down Expand Up @@ -85,8 +86,12 @@ public void testGeneratePackage() {

enumGenerator.generatePackage(clazz, ast, cu);

assertEquals("package de.crowdcode.kissmda.testapp.components;\n",
cu.toString());
String onlyPackage = cu.toString();
String expectedResult = "package de.crowdcode.kissmda.testapp.components;\n";

boolean isInside = onlyPackage.contains(expectedResult);

assertTrue(isInside);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
package de.crowdcode.kissmda.cartridges.simplejava;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

Expand Down Expand Up @@ -93,8 +94,12 @@ public void testGeneratePackage() {

interfaceGenerator.generatePackage(clazz, ast, cu);

assertEquals("package de.crowdcode.kissmda.testapp.components;\n",
cu.toString());
String onlyPackage = cu.toString();
String expectedResult = "package de.crowdcode.kissmda.testapp.components;\n";

boolean isInside = onlyPackage.contains(expectedResult);

assertTrue(isInside);
}

@SuppressWarnings("unchecked")
Expand Down

0 comments on commit 825b58f

Please sign in to comment.