Update of /cvsroot/mockobjects/mockobjects-java/src/core/test/mockobjects
In directory sc8-pr-cvs1:/tmp/cvs-serv16525/src/core/test/mockobjects
Added Files:
TestReturnValue.java
Log Message:
Added ReturnValue class
--- NEW FILE: TestReturnValue.java ---
package test.mockobjects;
import com.mockobjects.util.TestCaseMo;
import com.mockobjects.ReturnValue;
import junit.framework.AssertionFailedError;
public class TestReturnValue extends TestCaseMo {
private final ReturnValue value = new ReturnValue(getName());
public void testGetNull(){
value.setValue(null);
assertTrue(value.getValue()==null);
}
public void testGetValue(){
value.setValue(this);
assertEquals(this, value.getValue());
}
public void testValueNotSet() {
try {
value.getValue();
fail("Error not thrown");
} catch (AssertionFailedError e) {
assertEquals("The return value \"" + getName() + "\" has not been set.", e.getMessage());
}
}
public TestReturnValue(String name) {
super(name);
}
public static void main(String[] args) {
start(new String[] { TestReturnValue.class.getName()});
}
}
|