Commit a3c6ae99 authored by Tianyi Zuo's avatar Tianyi Zuo
Browse files

Finished adding results

parent 5937ce6f
......@@ -17,6 +17,19 @@ public class QueryProcessor {
"his works of hard science fiction and popular science. \n");
results.append(System.lineSeparator());
}
if (query.toLowerCase().contains("rory shu")) {
results.append("Rory Shu (9 March 1998 - ) is a Chinese JMC undergraduate\n" +
"living in London, famous for having a annoying bf (and his friend is\n"
+ "annoying too).\n");
results.append(System.lineSeparator());
}
if (query.toLowerCase().contains("nanfeng liu")) {
results.append("Nanfeng Liu (10 December 1998 - ) is a Chinese Computing undergraduate\n" +
"living in London. \n");
results.append(System.lineSeparator());
}
return results.toString();
}
}
......@@ -21,6 +21,11 @@ public class IndexPage implements Page {
"<p>Enter your query in the box below: " +
"<form>" +
"<input type=\"text\" name=\"q\" />" +
"<form action=\"\">" +
" <input type=\"radio\" name=\"file_type\" value=\"pdf\"> pdf<br>"+
// "<input type=\"radio\" name=\"gender\" value=\"female\"> Female<br>"+
// "<input type=\"radio\" name=\"gender\" value=\"other\"> Other"+
"</form>"+
"<br><br><input type=\"submit\">" +
"</form>" +
"</p>");
......
......@@ -25,8 +25,20 @@ public class QueryProcessorTest {
assertThat(queryProcessor.process("Asimov"), containsString("science fiction"));
}
@Test
public void knowsAboutRory() throws Exception {
assertThat(queryProcessor.process("rory shu"), containsString("JMC"));
}
@Test
public void knowsAboutNanfeng() throws Exception {
assertThat(queryProcessor.process("nanfeng liu"), containsString("Computing"));
}
@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