JavaAlgorithms
Elementary and no so elementary Java algorithms
|
00001 00009 package stringAlgorithms; 00010 00011 import static org.junit.Assert.*; 00012 00013 import org.junit.Test; 00014 00015 public class SentenceTest { 00016 00048 @Test 00049 public void testIsSentence() { 00050 SentenceRecognize rec = new SentenceRecognize(); 00051 if (! rec.isSentence("dropedapple") ) { // droped apple 00052 fail("Failed on dropedapple"); 00053 } 00054 if (! rec.isSentence("dropedith") ) { // drop edith 00055 fail("Failed on dropedith"); 00056 } 00057 if (rec.isSentence("dropedithh") ) { // fail - drop edith h 00058 fail("Failed on dropedithh"); 00059 } 00060 if (! rec.isSentence("arearmarea") ) { // are arm area 00061 fail("Failed on are arm area"); 00062 } 00063 if (rec.isSentence("cleverllever") ) { // clever l lever 00064 fail("Failed on cleverlever"); 00065 } 00066 if (! rec.isSentence("aappledoped")) { // a apple droped 00067 fail( "Failed on aappledoped" ); 00068 } 00069 if (rec.isSentence("deadbeef") ) { // deadbeef 00070 fail("Failed on deadbeef"); 00071 } 00072 if (! rec.isSentence("hedropedtheball") ) { // he droped the ball 00073 fail("Failed on hedropedtheball"); 00074 } 00075 if (! rec.isSentence("areanatcharm") ) { // arean at charm 00076 fail("Failed on areanatcharm"); 00077 } 00078 if (! rec.isSentence("atattachedith")) { // at attach edith 00079 fail("Failed on atattachedith"); 00080 } 00081 } 00082 00083 }