From 9c10936cf1420f160a5007c6baad7b25ffb6d014 Mon Sep 17 00:00:00 2001 From: HumairAK Date: Tue, 26 Jul 2016 16:44:06 -0400 Subject: Added more unit tests, fixed some bugs in the code, fixed voting alert prompts and redirects --- test/data/exam.json | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 test/data/exam.json (limited to 'test/data') diff --git a/test/data/exam.json b/test/data/exam.json new file mode 100644 index 0000000..0504679 --- /dev/null +++ b/test/data/exam.json @@ -0,0 +1,60 @@ +{ + "existing" : { + "_id": { + "$oid": "57917d4d2a73c0224fb6e763" + }, + "course_code": "CSC373", + "year": "2016", + "term": "Midterm", + "type": "Winter", + "instructors": [ + "Robert Dane" + ], + "page_count": "20", + "questions_count": "2", + "questions_list": [ + { + "q_id": 1, + "question": "Question 1" + }, + { + "q_id": 2, + "question": "Question 2" + } + ], + "upload_date": "2005-06-10", + "uploaded_by": [ + "humair", + "" + ] + }, + "nonExisting" : { + "_id": { + "$oid": "999999999999999999999999" + }, + "course_code": "CSC373", + "year": "2016", + "term": "Midterm", + "type": "Winter", + "instructors": [ + "Robert Dane" + ], + "page_count": "20", + "questions_count": "2", + "questions_list": [ + { + "q_id": 1, + "question": "Question 1" + }, + { + "q_id": 2, + "question": "Question 2" + } + ], + "upload_date": "2005-06-10", + "uploaded_by": [ + "humair", + "" + ] + } +} \ No newline at end of file -- cgit v1.2.3 From 9f65445e7fcd5cc5d9d3183cb280b1ba13ac30b7 Mon Sep 17 00:00:00 2001 From: HumairAK Date: Tue, 26 Jul 2016 17:31:27 -0400 Subject: more unit tests --- test/data/exam.json | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) (limited to 'test/data') diff --git a/test/data/exam.json b/test/data/exam.json index 0504679..ac9c0dc 100644 --- a/test/data/exam.json +++ b/test/data/exam.json @@ -1,32 +1,30 @@ { "existing" : { "_id": { - "$oid": "57917d4d2a73c0224fb6e763" + "$oid": "578a429640e1bf7e118a6b7b" }, - "course_code": "CSC373", - "year": "2016", - "term": "Midterm", - "type": "Winter", + "course_code": "CSC148", + "year": 2010, + "term": "fall", + "type": "midterm", "instructors": [ - "Robert Dane" + "Faith Ellen", + "Tom F." ], - "page_count": "20", - "questions_count": "2", + "page_count": 20, + "questions_count": 2, "questions_list": [ { "q_id": 1, - "question": "Question 1" + "question": "this is q1" }, { "q_id": 2, - "question": "Question 2" + "question": "this is q2" } ], - "upload_date": "2005-06-10", - "uploaded_by": [ - "humair", - "" - ] + "upload_date": "some date", + "uploaded_by": "some user name" }, "nonExisting" : { "_id": { -- cgit v1.2.3 From a546c76d5eb8dcf2efe8b305cdb997b64914728e Mon Sep 17 00:00:00 2001 From: HumairAK Date: Tue, 26 Jul 2016 18:53:36 -0400 Subject: added user test file --- test/data/user.json | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 test/data/user.json (limited to 'test/data') diff --git a/test/data/user.json b/test/data/user.json new file mode 100644 index 0000000..b8ca88d --- /dev/null +++ b/test/data/user.json @@ -0,0 +1,35 @@ +{ + "existingUser": { + "_id": { + "$oid": "57950d18543bc2fe7681f28c" + }, + "email": "kumar@kumar.com", + "user_name": "kumar", + "f_name": "KUMAR", + "l_name": "DAMANI", + "university": "", + "department": "", + "answered": 1, + "messages": 0, + "comments": 4, + "phone_num": "", + "followers": [] + }, + + "nonExistingUser": { + "_id": { + "$oid": "57950d18543bc2fe7681f28c" + }, + "email": "kumar@kumar.com", + "user_name": "kumarFake", + "f_name": "KUMAR", + "l_name": "DAMANI", + "university": "", + "department": "", + "answered": 1, + "messages": 0, + "comments": 4, + "phone_num": "", + "followers": [] + } +} \ No newline at end of file -- cgit v1.2.3