From 37709cec3aa3b5534ad246e86fde468f025f8339 Mon Sep 17 00:00:00 2001 From: Morten Telling Date: Fri, 28 Apr 2017 10:31:08 +0200 Subject: [PATCH] Added new tests --- .gitignore | 1 - Testing/Tests/Challenge_Five.json | 35 ++++++++++++++++++++++++++ Testing/Tests/Challenge_Six.json | 41 +++++++++++++++++++++++++++++++ 3 files changed, 76 insertions(+), 1 deletion(-) create mode 100644 Testing/Tests/Challenge_Five.json create mode 100644 Testing/Tests/Challenge_Six.json diff --git a/.gitignore b/.gitignore index 40c2b2b..9b291a9 100644 --- a/.gitignore +++ b/.gitignore @@ -72,6 +72,5 @@ node_modules/ .gradle/ .idea/ dist/ -Testing/ .DS_Store storedUsers.json diff --git a/Testing/Tests/Challenge_Five.json b/Testing/Tests/Challenge_Five.json new file mode 100644 index 0000000..dbd3cd5 --- /dev/null +++ b/Testing/Tests/Challenge_Five.json @@ -0,0 +1,35 @@ +{ + "name": "Find the n'th prime number.", + "description": "Given n as input, return the n'th prime.\n\nExample:\nGiven args[0] = \"10\" return 23.", + "filename": "Challenge_Five", + "tests": [ + { + "arguments": [ + "10" + ], + "expectedReturn": 23 + }, + { + "arguments": [ + "1000" + ], + "expectedReturn": 7907 + }, + { + "arguments": [ + "25000" + ], + "expectedReturn": 287107 + }, + { + "arguments": [ + "1" + ], + "expectedReturn": 2 + } + ], + "initialCode" : { + "java" : "public class Program {\n\tpublic Object run(String[] args) {\n\t\t//Type your code here...\n\t\treturn -1;\n\t}\n}", + "javascript" : "function program(args) {\n\treturn -1;\n}" + } +} \ No newline at end of file diff --git a/Testing/Tests/Challenge_Six.json b/Testing/Tests/Challenge_Six.json new file mode 100644 index 0000000..183ef08 --- /dev/null +++ b/Testing/Tests/Challenge_Six.json @@ -0,0 +1,41 @@ +{ + "name": "Palindromes", + "description": "Given a string as input, return true if the string is a palindrome and false if not.\nA palindrome is a word that is the same if you read it backwards as forwards.\n\nExamples:\nGiven args[0] = \"abba\" return true.\nGiven args[0] = \"abca\" return false.", + "filename": "Challenge_Six", + "tests": [ + { + "arguments": [ + "Copenhacks" + ], + "expectedReturn": false + }, + { + "arguments": [ + "abba" + ], + "expectedReturn": true + }, + { + "arguments": [ + "abbba" + ], + "expectedReturn": true + }, + { + "arguments": [ + "a" + ], + "expectedReturn": true + }, + { + "arguments": [ + "abca" + ], + "expectedReturn": false + } + ], + "initialCode" : { + "java" : "public class Program {\n\tpublic Object run(String[] args) {\n\t\t//Type your code here...\n\t\treturn false;\n\t}\n}", + "javascript" : "function program(args) {\n\treturn false;\n}" + } +} \ No newline at end of file