Commit deaa24c1 authored by Euan Imperial's avatar Euan Imperial
Browse files

Merge branch 'java_extensions' of...

Merge branch 'java_extensions' of https://gitlab.doc.ic.ac.uk/jlp19/simplewebapp into java_extensions
parents 6fc0114f 0bf79e08
Pipeline #171642 passed with stages
in 18 seconds
......@@ -36,8 +36,8 @@ public class QueryProcessor {
"Also regarded as a major prophet in Islam.");
results.append(System.lineSeparator());
}
if (query.toLowerCase().contains("buddah")) {
results.append("Buddah (563 - 483 BC)\n" +
if (query.toLowerCase().contains("buddha")) {
results.append("Buddha (563 - 483 BC)\n" +
"Spiritual teacher and philosopher from ancient India. Founder of Buddhism.");
results.append(System.lineSeparator());
}
......
......@@ -25,6 +25,30 @@ public class QueryProcessorTest {
assertThat(queryProcessor.process("Asimov"), containsString("science fiction"));
}
@Test
public void knowsAboutJesus() throws Exception {
assertThat(queryProcessor.process("Jesus"), containsString("Christianity"));
}
@Test
public void knowsAboutMuhammad() throws Exception {
assertThat(queryProcessor.process("Muhammad"), containsString("Islam"));
}
@Test
public void knowsAboutNewton() throws Exception {
assertThat(queryProcessor.process("Newton"), containsString("laws of motion"));
}
@Test
public void knowsAboutBuddha() throws Exception {
assertThat(queryProcessor.process("Buddha"), containsString("Buddhism"));
}
@Test
public void knowsAboutEinstein() throws Exception {
assertThat(queryProcessor.process("Einstein"), containsString("relativity"));
}
@Test
public void isNotCaseSensitive() throws Exception {
assertThat(queryProcessor.process("shakespeare"), containsString("playwright"));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment