Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

removed testrecusrivesearchterms #247

Merged
merged 1 commit into from
Nov 7, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 0 additions & 48 deletions src/test/java/guitests/TestMemoryFind.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ public void test() {
StorageMemory.checkForFileExists(testMem);

testSearchExact(testMem);
testRecursiveSearchTerms(testMem);
testFindDate(testMem);
}

Expand All @@ -33,14 +32,6 @@ private void testSearchExact(Memory testMem) {
testSearchExact_NonEmptyMem(testMem);
}

//@@author A0143378Y
private void testRecursiveSearchTerms(Memory testMem) {
testRecursiveSearchTerms_ZeroTerm(testMem);
testRecursiveSearchTerms_Space(testMem);
testRecursiveSearchTerms_OneTerm(testMem);
testRecursiveSearchTerms_MoreThanOneTerm(testMem);
}

//@@author A0143378Y
private void testFindDate(Memory testMem){
Calendar date = new GregorianCalendar();
Expand All @@ -67,45 +58,6 @@ private void testSearchExact_NonEmptyMem(Memory testMem) {
assertEquals("If mem is not empty, test if item can be found", testCase2.size(), 1);
}

//@@author A0143378Y
private void testRecursiveSearchTerms_ZeroTerm(Memory testMem) {
ArrayList<GenericMemory> result = new ArrayList<GenericMemory>(testMem.getList());
String[] keywords = {};
result = FindCommand.recursiveSearchTerms(keywords, 0, result);
assertEquals("search without criteria", result.size(), 17);
}

//@@author A0143378Y
private void testRecursiveSearchTerms_Space(Memory testMem){
ArrayList<GenericMemory> result = new ArrayList<GenericMemory>(testMem.getList());
String[] keywords = {" "};
result = FindCommand.recursiveSearchTerms(keywords, 0, result);

//One item without any space out of 5
assertEquals("search a space", result.size(), 13);
}

//@@author A0143378Y
private void testRecursiveSearchTerms_OneTerm(Memory testMem){
ArrayList<GenericMemory> result = new ArrayList<GenericMemory>(testMem.getList());
String[] keywords = {"hungry"};
result = FindCommand.recursiveSearchTerms(keywords, 0, result);
assertEquals("search for single term", result.size(), 2);
}

//@@author A0143378Y
private void testRecursiveSearchTerms_MoreThanOneTerm(Memory testMem){
ArrayList<GenericMemory> result = new ArrayList<GenericMemory>(testMem.getList());
String[] keywords = {"hungry", "very", "chicken"};
result = FindCommand.recursiveSearchTerms(keywords, 0, result);
assertEquals("search for more than 1 term successful", result.size(), 1);

ArrayList<GenericMemory> result2 = new ArrayList<GenericMemory>(testMem.getList());
String[] keywords2 = {"hungry", "very", "chicken", "still"};
result2 = FindCommand.recursiveSearchTerms(keywords2, 0, result2);
assertEquals("search for more than 1 term unsuccessful", result2.size(), 0);
}

//@@author A0143378Y
//Completely outside of any range
private void testFindDate_NoneExistent(Memory testMem, Calendar date){
Expand Down