SequenceTest -...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
import org.junit.*; import static org.junit.Assert.*; import org.junit.runner.Result; import static org.junit.runner.JUnitCore.runClasses; public class SequenceTest extends Sequence { public SequenceTest(String name) { p super(name); } // protected void setUp() { try { Sequence objSeq = new Sequence(); } catch (Exception e) { } e.printStackTrace(); } } // To run any code after tests are run. protected void tearDown() { } @Test public void testsize() { //Assert.assertTrue(objSeq.isPositiveInteger("1")); //Assert.assertFalse(objSeq.isPositiveInteger((String)null)); //Assert.assertFalse(objSeq.isPositiveInteger(""));
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: //Assert.assertFalse(objSeq.isPositiveInteger("123$%456")); } } // No tests are required for getter and setter methods as they just return and set values we define in constructor. @Test publci void testget(){ p Assert.assertNotNull(objSeq.get(1)); Assert.assertNotNull(objSeq.get(-1)); } public static void main(String args) { Result result = JUnitCore.runClasses(SequenceTest.class); for (Failure failure : result.getFailures()) { System.out.println(failure.toString()); } }...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online