Skip to content

Commit 5c239a2

Browse files
committed
outline for issue title tests
outline test cases and sections for the restrictions on titles described in the milestone document
1 parent 3bebd9c commit 5c239a2

File tree

6 files changed

+53
-1
lines changed

6 files changed

+53
-1
lines changed

docs/_pages/milestones.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,5 @@ For this first milestone, I want to be able to do the following:
3636
- more allowed values for status
3737

3838
### Notes:
39-
- **2021-08-13**: issue IDs should be all lower case (prefix and hash)
39+
- **2021-08-13**: issue IDs are all lower case (prefix and hash)
40+
- **2021-08-20**: titles are further restricted to printable ASCII characters (except backspace and backtick)

src/domain/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
set(DOMAIN_SOURCES
22
application_service.cpp
3+
title.cpp
34
)
45

56
add_library(domain ${DOMAIN_SOURCES})

src/domain/title.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#include "title.hpp"
2+
3+
using fix::domain::title;
4+
5+
bool title::create(std::string_view) { // NOLINT
6+
return false;
7+
}

src/domain/title.hpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#ifndef FIX_SRC_DOMAIN_TITLE_HPP
2+
#define FIX_SRC_DOMAIN_TITLE_HPP
3+
4+
#include <string_view>
5+
6+
namespace fix::domain {
7+
8+
class title {
9+
public:
10+
static bool create(std::string_view str);
11+
};
12+
13+
} // namespace fix::domain
14+
15+
#endif // FIX_SRC_DOMAIN_TITLE_HPP

test/domain/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
set(DOMAIN_TEST_SOURCES
22
application_service_test.cpp
3+
title_test.cpp
34
)
45

56
add_executable(domain_tests ${DOMAIN_TEST_SOURCES})

test/domain/title_test.cpp

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#include <catch2/catch.hpp>
2+
3+
#include "title.hpp"
4+
5+
using fix::domain::title;
6+
7+
TEST_CASE("Titles have restricted length") {
8+
SECTION("titles may not be empty") {
9+
CHECK_FALSE(title::create(""));
10+
}
11+
12+
SECTION("titles may not be too short") {}
13+
SECTION("titles may not be too long") {}
14+
SECTION("titles with a length in the allowed range can be created") {}
15+
}
16+
17+
TEST_CASE("Titles have a restricted character set") {
18+
SECTION("titles may contain alphanumeric characters and spaces") {}
19+
SECTION("titles may not contain line breaks and other non-space whitespace") {}
20+
SECTION("titles may not contain special punctuation characters") {
21+
SECTION("backspace") {}
22+
SECTION("backtick") {}
23+
}
24+
SECTION("titles may contain other punctuation characters") {}
25+
SECTION("titles may not contain backspace characters") {}
26+
SECTION("titles may not contain non-ASCII characters") {}
27+
}

0 commit comments

Comments
 (0)