KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > test > jmock > core > constraint > IsInstanceOfTest


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

3 package test.jmock.core.constraint;
4
5 import org.jmock.core.constraint.IsInstanceOf;
6
7
8 public class IsInstanceOfTest extends AbstractConstraintsTest
9 {
10     public void testEvaluatesToTrueIfArgumentIsInstanceOfASpecificClass() {
11         IsInstanceOf isInstanceOf = new IsInstanceOf(Number JavaDoc.class);
12
13         assertTrue(isInstanceOf.eval(new Integer JavaDoc(1)));
14         assertTrue(isInstanceOf.eval(new Double JavaDoc(1.0)));
15         assertFalse(isInstanceOf.eval("a string"));
16         assertFalse(isInstanceOf.eval(null));
17     }
18 }
19
Popular Tags