80 base_assert::fail(base_assert::to_string(expected) +
", ignoring case", base_assert::to_string(actual), message, stack_frame);
133 base_assert::fail(
"not " + base_assert::to_string(expected)+
", ignoring case", base_assert::to_string(actual), message, stack_frame);
187 if (
string.find(item) != xtd::ustring::npos)
190 base_assert::fail(
"string containing " + base_assert::to_string(item), base_assert::to_string(
string), message, stack_frame);
244 if (
string.find(item) == xtd::ustring::npos)
247 base_assert::fail(
"not string containing " + base_assert::to_string(item), base_assert::to_string(
string), message, stack_frame);
301 if (
string.find(item) == 0)
304 base_assert::fail(
"string starting with " + base_assert::to_string(item), base_assert::to_string(
string), message, stack_frame);
358 if (
string.find(item) != 0)
361 base_assert::fail(
"not string starting with " + base_assert::to_string(item), base_assert::to_string(
string), message, stack_frame);
415 if (
string.rfind(item) != xtd::ustring::npos)
418 base_assert::fail(
"string ending with " + base_assert::to_string(item), base_assert::to_string(
string), message, stack_frame);
472 if (
string.rfind(item) == xtd::ustring::npos)
475 base_assert::fail(
"not string ending with " + base_assert::to_string(item), base_assert::to_string(
string), message, stack_frame);
525 std::string pattern(regex_pattern);
526 std::regex
r(pattern);
528 std::string act(actual);
529 if (std::regex_search(act,
m,
r) ==
true)
532 base_assert::fail(
"string matching " + base_assert::to_string(regex_pattern), base_assert::to_string(actual), message, stack_frame);
582 std::string pattern(regex_pattern);
583 std::regex
r(pattern);
585 std::string act(actual);
586 if (std::regex_search(act,
m,
r) ==
false)
589 base_assert::fail(
"not string matching " + base_assert::to_string(regex_pattern), base_assert::to_string(actual), message, stack_frame);
595 #define are_equal_ignoring_case_(...) __CMD_ASSERT_ARGS(are_equal_ignoring_case, __VA_ARGS__)
597 #define are_not_equal_ignoring_case_(...) __CMD_ASSERT_ARGS(are_not_equal_ignoring_case, __VA_ARGS__)
599 #define does_not_end_with_(...) __CMD_ASSERT_ARGS(does_not_end_with, __VA_ARGS__)
601 #define does_not_match_(...) __CMD_ASSERT_ARGS(does_not_match, __VA_ARGS__)
603 #define does_not_start_with_(...) __CMD_ASSERT_ARGS(does_not_start_with, __VA_ARGS__)
605 #define ends_with_(...) __CMD_ASSERT_ARGS(ends_with, __VA_ARGS__)
607 #define matches_(...) __CMD_ASSERT_ARGS(matches, __VA_ARGS__)
609 #define starts_with_(...) __CMD_ASSERT_ARGS(starts_with, __VA_ARGS__)
Contains xtd::tunit::assert class.
Provides information about a xtd::diagnostics::stack_frame, which represents a function call on the c...
Definition: stack_frame.h:29
static stack_frame empty() noexcept
Return an empty stack frame.
The base class for assert.
Definition: base_assert.h:25
static void fail()
Throws an xtd::tunit::assertion_error exception. This is used by the other Assert functions.
Definition: base_assert.h:70
static void succeed()
Generates a success with a generic message. This is used by the other Assert functions.
Definition: base_assert.h:140
The string_assert class contains a collection of static methods that implement the most string assert...
Definition: string_assert.h:24
static void does_not_start_with(const xtd::ustring &item, const xtd::ustring &string)
Asserts that string does not start with a specific item.
Definition: string_assert.h:317
static void matches(const xtd::ustring ®ex_pattern, const xtd::ustring &actual, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that matches regex pattern.
Definition: string_assert.h:499
static void does_not_start_with(const xtd::ustring &item, const xtd::ustring &string, const xtd::ustring &message, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that string starts with item.
Definition: string_assert.h:357
static void does_not_start_with(const xtd::ustring &item, const xtd::ustring &string, const xtd::ustring &message)
Asserts that string starts with item.
Definition: string_assert.h:343
static void does_not_match(const xtd::ustring ®ex_pattern, const xtd::ustring &actual, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that does not match regex pattern.
Definition: string_assert.h:556
static void ends_with(const xtd::ustring &item, const xtd::ustring &string, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that string starts with item.
Definition: string_assert.h:387
static void does_not_end_with(const xtd::ustring &item, const xtd::ustring &string)
Asserts that string does not end with a specific item.
Definition: string_assert.h:431
static void contains(const xtd::ustring &item, const xtd::ustring &string)
Asserts that string contains an item.
Definition: string_assert.h:146
static void does_not_end_with(const xtd::ustring &item, const xtd::ustring &string, const xtd::ustring &message)
Asserts that string starts with item.
Definition: string_assert.h:457
static void does_not_contain(const xtd::ustring &item, const xtd::ustring &string, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that string contains an item.
Definition: string_assert.h:216
static void starts_with(const xtd::ustring &item, const xtd::ustring &string, const xtd::ustring &message)
Asserts that string starts with item.
Definition: string_assert.h:286
static void does_not_contain(const xtd::ustring &item, const xtd::ustring &string)
Asserts that string contains an item.
Definition: string_assert.h:203
static void does_not_match(const xtd::ustring ®ex_pattern, const xtd::ustring &actual, const xtd::ustring &message)
Asserts that does not match regex pattern.
Definition: string_assert.h:568
static void does_not_match(const xtd::ustring ®ex_pattern, const xtd::ustring &actual, const xtd::ustring &message, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that does not match regex pattern.
Definition: string_assert.h:581
static void contains(const xtd::ustring &item, const xtd::ustring &string, const xtd::ustring &message, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that string contains an item.
Definition: string_assert.h:186
static void does_not_match(const xtd::ustring ®ex_pattern, const xtd::ustring &actual)
Asserts that does not match regex pattern.
Definition: string_assert.h:544
static void does_not_end_with(const xtd::ustring &item, const xtd::ustring &string, const xtd::ustring &message, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that string starts with item.
Definition: string_assert.h:471
static void are_equal_ignoring_case(const xtd::ustring &expected, const xtd::ustring &actual, const xtd::ustring &message)
Asserts that two type are equal ignoring case.
Definition: string_assert.h:63
static void does_not_contain(const xtd::ustring &item, const xtd::ustring &string, const xtd::ustring &message, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that string contains an item.
Definition: string_assert.h:243
static void starts_with(const xtd::ustring &item, const xtd::ustring &string)
Asserts that string starts witdh item.
Definition: string_assert.h:260
static void contains(const xtd::ustring &item, const xtd::ustring &string, const xtd::ustring &message)
Asserts that string contains an item.
Definition: string_assert.h:172
static void starts_with(const xtd::ustring &item, const xtd::ustring &string, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that string starts with item.
Definition: string_assert.h:273
static void ends_with(const xtd::ustring &item, const xtd::ustring &string, const xtd::ustring &message, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that string starts with item.
Definition: string_assert.h:414
static void are_not_equal_ignoring_case(const xtd::ustring &expected, const xtd::ustring &actual)
Asserts that two type are not equal ignoring case.
Definition: string_assert.h:92
static void matches(const xtd::ustring ®ex_pattern, const xtd::ustring &actual, const xtd::ustring &message, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that matches regex pattern.
Definition: string_assert.h:524
static void does_not_start_with(const xtd::ustring &item, const xtd::ustring &string, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that string starts with item.
Definition: string_assert.h:330
static void ends_with(const xtd::ustring &item, const xtd::ustring &string)
Asserts that string ends with a specific item.
Definition: string_assert.h:374
static void are_not_equal_ignoring_case(const xtd::ustring &expected, const xtd::ustring &actual, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that two type are not equal ignoring case.
Definition: string_assert.h:104
static void are_equal_ignoring_case(const xtd::ustring &expected, const xtd::ustring &actual)
Asserts that two type are equal ignoring case.
Definition: string_assert.h:39
static void are_not_equal_ignoring_case(const xtd::ustring &expected, const xtd::ustring &actual, const xtd::ustring &message, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that two type are not equal ignoring case.
Definition: string_assert.h:129
static void matches(const xtd::ustring ®ex_pattern, const xtd::ustring &actual, const xtd::ustring &message)
Asserts that matches regex pattern.
Definition: string_assert.h:511
static void starts_with(const xtd::ustring &item, const xtd::ustring &string, const xtd::ustring &message, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that string starts with item.
Definition: string_assert.h:300
static void are_not_equal_ignoring_case(const xtd::ustring &expected, const xtd::ustring &actual, const xtd::ustring &message)
Asserts that two type are not equal ignoring case.
Definition: string_assert.h:116
static void ends_with(const xtd::ustring &item, const xtd::ustring &string, const xtd::ustring &message)
Asserts that string starts with item.
Definition: string_assert.h:400
static void are_equal_ignoring_case(const xtd::ustring &expected, const xtd::ustring &actual, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that two type are equal ignoring case.
Definition: string_assert.h:51
static void does_not_end_with(const xtd::ustring &item, const xtd::ustring &string, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that string starts with item.
Definition: string_assert.h:444
static void contains(const xtd::ustring &item, const xtd::ustring &string, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that string contains an item.
Definition: string_assert.h:159
static void matches(const xtd::ustring ®ex_pattern, const xtd::ustring &actual)
Asserts that matches regex pattern.
Definition: string_assert.h:487
static void does_not_contain(const xtd::ustring &item, const xtd::ustring &string, const xtd::ustring &message)
Asserts that string contains an item.
Definition: string_assert.h:229
static void are_equal_ignoring_case(const xtd::ustring &expected, const xtd::ustring &actual, const xtd::ustring &message, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that two type are equal ignoring case.
Definition: string_assert.h:76
Represents text as a sequence of UTF-8 code units.
Definition: ustring.h:48
ustring to_lower() const noexcept
Returns a copy of the current string converted to lowercase.
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition: system_report.h:17
Contains xtd::ustring class.