xtd 0.2.0
Loading...
Searching...
No Matches
string_assert.h
Go to the documentation of this file.
1
4#pragma once
5#include <xtd/string>
6#include "assert.h"
7#include <regex>
8
10namespace xtd {
12 namespace tunit {
25 class tunit_export_ string_assert final : private base_assert {
26 public:
28 string_assert() = delete;
30
32
43 static void are_equal_ignoring_case(const xtd::string& expected, const xtd::string& actual);
54 static void are_equal_ignoring_case(const xtd::string& expected, const xtd::string& actual, const xtd::diagnostics::stack_frame& stack_frame);
65 static void are_equal_ignoring_case(const xtd::string& expected, const xtd::string& actual, const xtd::string& message);
77 static void are_equal_ignoring_case(const xtd::string& expected, const xtd::string& actual, const xtd::string& message, const xtd::diagnostics::stack_frame& stack_frame);
78
88 static void are_not_equal_ignoring_case(const xtd::string& expected, const xtd::string& actual);
99 static void are_not_equal_ignoring_case(const xtd::string& expected, const xtd::string& actual, const xtd::diagnostics::stack_frame& stack_frame);
110 static void are_not_equal_ignoring_case(const xtd::string& expected, const xtd::string& actual, const xtd::string& message);
122 static void are_not_equal_ignoring_case(const xtd::string& expected, const xtd::string& actual, const xtd::string& message, const xtd::diagnostics::stack_frame& stack_frame);
123
134 static void contains(const xtd::string& item, const xtd::string& string);
146 static void contains(const xtd::string& item, const xtd::string& string, const xtd::diagnostics::stack_frame& stack_frame);
158 static void contains(const xtd::string& item, const xtd::string& string, const xtd::string& message);
171 static void contains(const xtd::string& item, const xtd::string& string, const xtd::string& message, const xtd::diagnostics::stack_frame& stack_frame);
172
183 static void does_not_contain(const xtd::string& item, const xtd::string& string);
195 static void does_not_contain(const xtd::string& item, const xtd::string& string, const xtd::diagnostics::stack_frame& stack_frame);
207 static void does_not_contain(const xtd::string& item, const xtd::string& string, const xtd::string& message);
220 static void does_not_contain(const xtd::string& item, const xtd::string& string, const xtd::string& message, const xtd::diagnostics::stack_frame& stack_frame);
221
232 static void does_not_end_with(const xtd::string& item, const xtd::string& string);
244 static void does_not_end_with(const xtd::string& item, const xtd::string& string, const xtd::diagnostics::stack_frame& stack_frame);
256 static void does_not_end_with(const xtd::string& item, const xtd::string& string, const xtd::string& message);
269 static void does_not_end_with(const xtd::string& item, const xtd::string& string, const xtd::string& message, const xtd::diagnostics::stack_frame& stack_frame);
270
280 static void does_not_match(const xtd::string& regex_pattern, const xtd::string& actual);
291 static void does_not_match(const xtd::string& regex_pattern, const xtd::string& actual, const xtd::diagnostics::stack_frame& stack_frame);
302 static void does_not_match(const xtd::string& regex_pattern, const xtd::string& actual, const xtd::string& message);
314 static void does_not_match(const xtd::string& regex_pattern, const xtd::string& actual, const xtd::string& message, const xtd::diagnostics::stack_frame& stack_frame);
315
326 static void does_not_start_with(const xtd::string& item, const xtd::string& string);
338 static void does_not_start_with(const xtd::string& item, const xtd::string& string, const xtd::diagnostics::stack_frame& stack_frame);
350 static void does_not_start_with(const xtd::string& item, const xtd::string& string, const xtd::string& message);
363 static void does_not_start_with(const xtd::string& item, const xtd::string& string, const xtd::string& message, const xtd::diagnostics::stack_frame& stack_frame);
364
375 static void ends_with(const xtd::string& item, const xtd::string& string);
387 static void ends_with(const xtd::string& item, const xtd::string& string, const xtd::diagnostics::stack_frame& stack_frame);
399 static void ends_with(const xtd::string& item, const xtd::string& string, const xtd::string& message);
412 static void ends_with(const xtd::string& item, const xtd::string& string, const xtd::string& message, const xtd::diagnostics::stack_frame& stack_frame);
413
423 static void matches(const xtd::string& regex_pattern, const xtd::string& actual);
434 static void matches(const xtd::string& regex_pattern, const xtd::string& actual, const xtd::diagnostics::stack_frame& stack_frame);
445 static void matches(const xtd::string& regex_pattern, const xtd::string& actual, const xtd::string& message);
457 static void matches(const xtd::string& regex_pattern, const xtd::string& actual, const xtd::string& message, const xtd::diagnostics::stack_frame& stack_frame);
458
469 static void starts_with(const xtd::string& item, const xtd::string& string);
481 static void starts_with(const xtd::string& item, const xtd::string& string, const xtd::diagnostics::stack_frame& stack_frame);
493 static void starts_with(const xtd::string& item, const xtd::string& string, const xtd::string& message);
506 static void starts_with(const xtd::string& item, const xtd::string& string, const xtd::string& message, const xtd::diagnostics::stack_frame& stack_frame);
508 };
509 }
510}
511
528#define are_equal_ignoring_case_(...) __CMD_ASSERT_ARGS(are_equal_ignoring_case, __VA_ARGS__)
529
546#define are_not_equal_ignoring_case_(...) __CMD_ASSERT_ARGS(are_not_equal_ignoring_case, __VA_ARGS__)
547
565#define does_not_end_with_(...) __CMD_ASSERT_ARGS(does_not_end_with, __VA_ARGS__)
566
583#define does_not_match_(...) __CMD_ASSERT_ARGS(does_not_match, __VA_ARGS__)
584
602#define does_not_start_with_(...) __CMD_ASSERT_ARGS(does_not_start_with, __VA_ARGS__)
603
621#define ends_with_(...) __CMD_ASSERT_ARGS(ends_with, __VA_ARGS__)
622
639#define matches_(...) __CMD_ASSERT_ARGS(matches, __VA_ARGS__)
640
658#define starts_with_(...) __CMD_ASSERT_ARGS(starts_with, __VA_ARGS__)
Represents text as a sequence of character units.
Definition basic_string.h:79
Provides information about a xtd::diagnostics::stack_frame, which represents a function call on the c...
Definition stack_frame.h:47
The base class for assert.
Definition base_assert.h:29
The string_assert class contains a collection of static methods that implement the most string assert...
Definition string_assert.h:25
static void contains(const xtd::string &item, const xtd::string &string, const xtd::string &message, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that string contains an item.
static void ends_with(const xtd::string &item, const xtd::string &string)
Asserts that string ends with a specific item.
static void matches(const xtd::string &regex_pattern, const xtd::string &actual, const xtd::string &message, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that matches regex pattern.
static void does_not_match(const xtd::string &regex_pattern, const xtd::string &actual, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that does not match regex pattern.
static void matches(const xtd::string &regex_pattern, const xtd::string &actual, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that matches regex pattern.
static void are_not_equal_ignoring_case(const xtd::string &expected, const xtd::string &actual, const xtd::string &message, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that two type are not equal ignoring case.
static void does_not_contain(const xtd::string &item, const xtd::string &string, const xtd::string &message)
Asserts that string contains an item.
static void starts_with(const xtd::string &item, const xtd::string &string, const xtd::string &message)
Asserts that string starts with item.
static void are_not_equal_ignoring_case(const xtd::string &expected, const xtd::string &actual, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that two type are not equal ignoring case.
static void starts_with(const xtd::string &item, const xtd::string &string, const xtd::string &message, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that string starts with item.
static void does_not_start_with(const xtd::string &item, const xtd::string &string)
Asserts that string does not start with a specific item.
static void does_not_start_with(const xtd::string &item, const xtd::string &string, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that string starts with item.
static void starts_with(const xtd::string &item, const xtd::string &string)
Asserts that string starts witdh item.
static void does_not_match(const xtd::string &regex_pattern, const xtd::string &actual, const xtd::string &message, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that does not match regex pattern.
static void ends_with(const xtd::string &item, const xtd::string &string, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that string starts with item.
static void does_not_end_with(const xtd::string &item, const xtd::string &string)
Asserts that string does not end with a specific item.
static void contains(const xtd::string &item, const xtd::string &string, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that string contains an item.
static void does_not_end_with(const xtd::string &item, const xtd::string &string, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that string starts with item.
static void does_not_contain(const xtd::string &item, const xtd::string &string, const xtd::string &message, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that string contains an item.
static void are_equal_ignoring_case(const xtd::string &expected, const xtd::string &actual, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that two type are equal ignoring case.
static void ends_with(const xtd::string &item, const xtd::string &string, const xtd::string &message, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that string starts with item.
static void are_not_equal_ignoring_case(const xtd::string &expected, const xtd::string &actual, const xtd::string &message)
Asserts that two type are not equal ignoring case.
static void are_equal_ignoring_case(const xtd::string &expected, const xtd::string &actual, const xtd::string &message, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that two type are equal ignoring case.
static void are_not_equal_ignoring_case(const xtd::string &expected, const xtd::string &actual)
Asserts that two type are not equal ignoring case.
static void starts_with(const xtd::string &item, const xtd::string &string, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that string starts with item.
static void are_equal_ignoring_case(const xtd::string &expected, const xtd::string &actual, const xtd::string &message)
Asserts that two type are equal ignoring case.
static void does_not_contain(const xtd::string &item, const xtd::string &string)
Asserts that string contains an item.
static void does_not_end_with(const xtd::string &item, const xtd::string &string, const xtd::string &message, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that string starts with item.
static void does_not_match(const xtd::string &regex_pattern, const xtd::string &actual, const xtd::string &message)
Asserts that does not match regex pattern.
static void contains(const xtd::string &item, const xtd::string &string)
Asserts that string contains an item.
static void does_not_match(const xtd::string &regex_pattern, const xtd::string &actual)
Asserts that does not match regex pattern.
static void does_not_end_with(const xtd::string &item, const xtd::string &string, const xtd::string &message)
Asserts that string starts with item.
static void ends_with(const xtd::string &item, const xtd::string &string, const xtd::string &message)
Asserts that string starts with item.
static void matches(const xtd::string &regex_pattern, const xtd::string &actual)
Asserts that matches regex pattern.
static void matches(const xtd::string &regex_pattern, const xtd::string &actual, const xtd::string &message)
Asserts that matches regex pattern.
static void does_not_contain(const xtd::string &item, const xtd::string &string, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that string contains an item.
static void are_equal_ignoring_case(const xtd::string &expected, const xtd::string &actual)
Asserts that two type are equal ignoring case.
static void contains(const xtd::string &item, const xtd::string &string, const xtd::string &message)
Asserts that string contains an item.
static void does_not_start_with(const xtd::string &item, const xtd::string &string, const xtd::string &message, const xtd::diagnostics::stack_frame &stack_frame)
Asserts that string starts with item.
static void does_not_start_with(const xtd::string &item, const xtd::string &string, const xtd::string &message)
Asserts that string starts with item.
#define tunit_export_
Define shared library export.
Definition tunit_export.h:13
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.h:10
Contains xtd::tunit::assert class.