Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,48 @@
import static ExampleClass.pali; // or from wherever it is defined
import static ExampleClass.rPali; // or from wherever it is defined
import org.junit.*;
public class PalindromeTest extends junit.framework.TestCase {
@Before
public void setUp(){
//runs before each test
//set up instance variables, network connections, etc. needed for all tests
}
@After
public void tearDown(){
//runs after each test
//clean up instance variables (close files, network connections, etc.).
}
/**
* Test the pali(...) method.
*/
@Test
public void testNonrecursivePali() throws Exception {
assertTrue(pali("abcba"));
assertTrue(pali("aa"));
assertTrue(pali("a"));
assertTrue(pali(""));
assertFalse(pali("ab"));
assertFalse(pali("abcdba"));
}
/**
* Test the rPali(...) method.
*/
@Test
public void testRecursivePali() throws Exception {
assertTrue(rPali("abcba"));
assertTrue(rPali("aa"));
assertTrue(rPali("a"));
assertTrue(rPali(""));
assertFalse(rPali("ab"));
assertFalse(rPali("abcdba"));
}
/**
* Expect a WhateverExcpetion
*/
@Test(expected=WhateverException.class)
public void except(){
//some code that should throw a WhateverException
}
}

View file

@ -0,0 +1,5 @@
public class RunTests{
public static main(String[] args){
org.junit.runner.JUnitCore.runClasses(PalindromeTest.class/*, other classes here if you have more*/);
}
}