Skip to content

Commit

Permalink
Fixed the BasicSceneGeneratorTest: nothing is drawn by this generator…
Browse files Browse the repository at this point in the history
… -> expect zero elements; test the right class

Signed-off-by: Rajarshi  Guha <rajarshi.guha@gmail.com>
  • Loading branch information
egonw authored and rajarshi committed Jun 27, 2011
1 parent 8eba14e commit b0c50cd
Showing 1 changed file with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
*/
public class BasicSceneGeneratorTest extends AbstractGeneratorTest {

private BasicAtomGenerator generator;
private BasicSceneGenerator generator;

@Override
public Rectangle getCustomCanvas() {
Expand All @@ -53,7 +53,7 @@ public Rectangle getCustomCanvas() {
@Before
public void setup() {
super.setup();
this.generator = new BasicAtomGenerator();
this.generator = new BasicSceneGenerator();
model.registerParameters(generator);
}

Expand All @@ -74,11 +74,7 @@ public void testSingleBond() {
// generate the single line element
IRenderingElement root = generator.generate(container, model);
List<IRenderingElement> elements = elementUtil.getAllSimpleElements(root);
Assert.assertEquals(1, elements.size());

// test that the endpoints are distinct
LineElement line = (LineElement) elements.get(0);
Assert.assertNotSame(0, AbstractGeneratorTest.length(line));
Assert.assertEquals(0, elements.size());
}

@Test
Expand All @@ -88,7 +84,7 @@ public void testSquare() {
// generate all four bonds
IRenderingElement root = generator.generate(square, model);
List<IRenderingElement> elements = elementUtil.getAllSimpleElements(root);
Assert.assertEquals(4, elements.size());
Assert.assertEquals(0, elements.size());

// test that the center is at the origin
Assert.assertEquals(new Point2d(0,0), center(elements));
Expand Down

0 comments on commit b0c50cd

Please sign in to comment.