KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > test > jmock > examples > calculator > expression > LiteralTest


1 /* Copyright (c) 2000-2004 jMock.org
2  */

3 package test.jmock.examples.calculator.expression;
4
5 import junit.framework.TestCase;
6 import org.jmock.examples.calculator.SimpleEnvironment;
7 import org.jmock.examples.calculator.expression.Literal;
8
9
10 public class LiteralTest extends TestCase
11 {
12     public void testEvaluatesToValuePassedToConstructor() {
13         SimpleEnvironment environment = new SimpleEnvironment();
14
15         for (int i = 0; i <= 10; i++) {
16             assertEquals(i, (new Literal(i)).evaluate(environment), 0.0);
17         }
18     }
19 }
20
Popular Tags