author | Jaroslav Tulach <jtulach@netbeans.org> |
Sat, 14 Jun 2008 09:58:11 +0200 | |
changeset 154 | 0fd5e9c500b9 |
parent 153 | b5cbb797ec0a |
permissions | -rw-r--r-- |
jtulach@54 | 1 |
package apifest; |
jtulach@54 | 2 |
|
jtulach@54 | 3 |
import junit.framework.TestCase; |
jtulach@54 | 4 |
import org.netbeans.apifest.boolcircuit.Circuit; |
jtulach@54 | 5 |
|
jtulach@54 | 6 |
|
jtulach@54 | 7 |
/** Write a test that works with version from day A and fails with version B. |
jtulach@54 | 8 |
*/ |
jtulach@59 | 9 |
// BEGIN: apifest.day3.against-elementbasedsolution |
jtulach@54 | 10 |
public class CircuitTest extends TestCase { |
jtulach@54 | 11 |
public CircuitTest(String n) { |
jtulach@54 | 12 |
super(n); |
jtulach@54 | 13 |
} |
jtulach@54 | 14 |
/** |
jtulach@154 | 15 |
* OK, elementbasedsolution looked bulletproof. Every code path |
jtulach@154 | 16 |
* was exactly the same as in the initial version. Except one. |
jtulach@54 | 17 |
*/ |
jtulach@54 | 18 |
public void testEvaluateWithoutAssign() throws Exception { |
jtulach@54 | 19 |
Circuit.Variable var = Circuit.var(); |
jtulach@54 | 20 |
Circuit.Element circuit = Circuit.not(var); |
jtulach@54 | 21 |
|
jtulach@54 | 22 |
assertTrue (circuit.result()); |
jtulach@54 | 23 |
} |
jtulach@54 | 24 |
} |
jtulach@59 | 25 |
// END: apifest.day3.against-elementbasedsolution |
jtulach@59 | 26 |
|
jtulach@59 | 27 |