forked from Ak0s/zerda-exam-cpp-orientation
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
61 lines (51 loc) · 1.78 KB
/
main.cpp
File metadata and controls
61 lines (51 loc) · 1.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#include <iostream>
#include <string>
#include <fstream>
#include "cypher.h"
#include "argument.h"
using namespace std;
/*#ifndef CATCH_CONFIG_MAIN
#define CATCH_CONFIG_MAIN
#include "catch.hpp"
#include "cypher.h"
TEST_CASE("Cypher::cypher_converter _ can shift alphabets") {
string test_word = "a";
Cypher test_case;
REQUIRE(test_case.cypher_converter(test_word, 1) == "b");
}
TEST_CASE("Cypher::cypher_converter _ can shift alphabets, after abc ended, begin from a") {
string test_word = "z";
Cypher test_case;
REQUIRE(test_case.cypher_converter(test_word, 3) == "c");
}
TEST_CASE("Cypher::cypher_converter _ is case sensitive") {
string test_word = "Bring";
Cypher test_case;
REQUIRE(test_case.cypher_converter(test_word, 1) == "Csjoh");
}
TEST_CASE("Cypher::cypher_converter _ not change the numbers, whitespace charactes(tabs, spaces, new lines) and any punctuation") {
string test_word = "Bring a small pan 2 me!";
Cypher test_case;
REQUIRE(test_case.cypher_converter(test_word, 1) == "Csjoh b tnbmm qbo 2 nf!");
}
TEST_CASE("Cypher::run_cypher_and_copy_to_file _ can finish") {
string test_word = "Case";
Cypher test_case;
REQUIRE(test_case.run_cypher_and_copy_to_file("original_text_file.txt", "cypher_text_file.txt", 4));
}*/
int main(int argc, char * const argv[]) {
/*string input_filename, output_filename;
int shift_num;
cout << "Enter input filename:" << endl;
cin >> input_filename;
cout << "Enter shift number: " << endl;
cin >> shift_num;
cout << "Enter output filename:" << endl;
cin >> output_filename;
cout << "Encoding finished." <<endl;
Cypher run;
run.run_cypher_and_copy_to_file(input_filename, output_filename, shift_num);
*/
Argument start(argc, argv, "original_text_file.txt");
start.run();
}