xtd - Reference Guide  0.1.0
Modern c++17/20 framework to create console, GUI and unit test applications on Windows, macOS, Linux, iOS and android.
Loading...
Searching...
No Matches
Static Public Member Functions | List of all members
xtd::tunit::string_assume Class Referencefinal

#include <string_assume.h>

Definition

The string_assume class contains a collection of static methods that implement the most string assertions used in xtd::tUnit.

Namespace
xtd::tunit
Library
xtd.tunit
Examples
This example show how to used some methods :
#include <xtd/xtd.tunit>
#include <stdexcept>
using namespace xtd::tunit;
namespace unit_tests {
// The class test must be declared with test_class_ helper.
class test_class_(test) {
public:
void test_method_(test_case1) {
assert::is_true(true);
}
void test_method_(test_case2) {
assert::is_false(true);
}
void test_method_(test_case3) {
assert::does_not_throw([] {throw std::range_error("error");});
}
};
}
int main() {
return console_unit_test().run();
}
// This code can produce the following output:
//
// Start 3 tests from 1 test case
// Run tests:
// SUCCEED test.test_case1 (0 ms total)
// FAILED test.test_case2 (0 ms total)
// Expected: false
// But was: true
// Stack Trace: in | --OMITTED-- |/assert.cpp:14
// FAILED test.test_case3 (0 ms total)
// Expected: No Exception to be thrown
// But was: <std::range_error>
// Stack Trace: in | --OMITTED-- |/assert.cpp:18
//
// Test results:
// SUCCEED 1 test.
// FAILED 2 tests.
// End 3 tests from 1 test case ran. (0 ms total)
The console_unit_test class is console unit test interface.
Definition: console_unit_test.h:23
int run()
Runs all tests in this UnitTest object and prints the result.
Definition: unit_test.h:44
The tunit namespace contains a unit test library.
Definition: abort_error.h:11

Inherits xtd::tunit::base_assert.

Static Public Member Functions

static void are_equal_ignoring_case (const xtd::ustring &expected, const xtd::ustring &actual)
 Validates that two type are equal ignoring case.
 
static void are_equal_ignoring_case (const xtd::ustring &expected, const xtd::ustring &actual, const xtd::diagnostics::stack_frame &stack_frame)
 Validates that two type are equal ignoring case.
 
static void are_equal_ignoring_case (const xtd::ustring &expected, const xtd::ustring &actual, const xtd::ustring &message)
 Validates that two type are equal ignoring case.
 
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)
 Validates that two type are equal ignoring case.
 
static void are_not_equal_ignoring_case (const xtd::ustring &expected, const xtd::ustring &actual)
 Validates that two type are not equal ignoring case.
 
static void are_not_equal_ignoring_case (const xtd::ustring &expected, const xtd::ustring &actual, const xtd::diagnostics::stack_frame &stack_frame)
 Validates that two type are not equal ignoring case.
 
static void are_not_equal_ignoring_case (const xtd::ustring &expected, const xtd::ustring &actual, const xtd::ustring &message)
 Validates that two type are not equal ignoring case.
 
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)
 Validates that two type are not equal ignoring case.
 
static void contains (const xtd::ustring &item, const xtd::ustring &string)
 Validates that string contains an item.
 
static void contains (const xtd::ustring &item, const xtd::ustring &string, const xtd::diagnostics::stack_frame &stack_frame)
 Validates that string contains an item.
 
static void contains (const xtd::ustring &item, const xtd::ustring &string, const xtd::ustring &message)
 Validates that string contains an item.
 
static void contains (const xtd::ustring &item, const xtd::ustring &string, const xtd::ustring &message, const xtd::diagnostics::stack_frame &stack_frame)
 Validates that string contains an item.
 
static void does_not_contain (const xtd::ustring &item, const xtd::ustring &string)
 Validates that string contains an item.
 
static void does_not_contain (const xtd::ustring &item, const xtd::ustring &string, const xtd::diagnostics::stack_frame &stack_frame)
 Validates that string contains an item.
 
static void does_not_contain (const xtd::ustring &item, const xtd::ustring &string, const xtd::ustring &message)
 Validates that string contains an item.
 
static void does_not_contain (const xtd::ustring &item, const xtd::ustring &string, const xtd::ustring &message, const xtd::diagnostics::stack_frame &stack_frame)
 Validates that string contains an item.
 
static void does_not_end_with (const xtd::ustring &item, const xtd::ustring &string)
 Validates that string does not end with a specific item.
 
static void does_not_end_with (const xtd::ustring &item, const xtd::ustring &string, const xtd::diagnostics::stack_frame &stack_frame)
 Validates that string starts with item.
 
static void does_not_end_with (const xtd::ustring &item, const xtd::ustring &string, const xtd::ustring &message)
 Validates that string starts with item.
 
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)
 Validates that string starts with item.
 
static void does_not_match (const xtd::ustring &regex_pattern, const xtd::ustring &actual)
 Validates that does not match regex pattern.
 
static void does_not_match (const xtd::ustring &regex_pattern, const xtd::ustring &actual, const xtd::diagnostics::stack_frame &stack_frame)
 Validates that does not match regex pattern.
 
static void does_not_match (const xtd::ustring &regex_pattern, const xtd::ustring &actual, const xtd::ustring &message)
 Validates that does not match regex pattern.
 
static void does_not_match (const xtd::ustring &regex_pattern, const xtd::ustring &actual, const xtd::ustring &message, const xtd::diagnostics::stack_frame &stack_frame)
 Validates that does not match regex pattern.
 
static void does_not_start_with (const xtd::ustring &item, const xtd::ustring &string)
 Validates that string does not start with a specific item.
 
static void does_not_start_with (const xtd::ustring &item, const xtd::ustring &string, const xtd::diagnostics::stack_frame &stack_frame)
 Validates that string starts with item.
 
static void does_not_start_with (const xtd::ustring &item, const xtd::ustring &string, const xtd::ustring &message)
 Validates that string starts with item.
 
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)
 Validates that string starts with item.
 
static void ends_with (const xtd::ustring &item, const xtd::ustring &string)
 Validates that string ends with a specific item.
 
static void ends_with (const xtd::ustring &item, const xtd::ustring &string, const xtd::diagnostics::stack_frame &stack_frame)
 Validates that string starts with item.
 
static void ends_with (const xtd::ustring &item, const xtd::ustring &string, const xtd::ustring &message)
 Validates that string starts with item.
 
static void ends_with (const xtd::ustring &item, const xtd::ustring &string, const xtd::ustring &message, const xtd::diagnostics::stack_frame &stack_frame)
 Validates that string starts with item.
 
static void matches (const xtd::ustring &regex_pattern, const xtd::ustring &actual)
 Validates that matches regex pattern.
 
static void matches (const xtd::ustring &regex_pattern, const xtd::ustring &actual, const xtd::diagnostics::stack_frame &stack_frame)
 Validates that matches regex pattern.
 
static void matches (const xtd::ustring &regex_pattern, const xtd::ustring &actual, const xtd::ustring &message)
 Validates that matches regex pattern.
 
static void matches (const xtd::ustring &regex_pattern, const xtd::ustring &actual, const xtd::ustring &message, const xtd::diagnostics::stack_frame &stack_frame)
 Validates that matches regex pattern.
 
static void starts_with (const xtd::ustring &item, const xtd::ustring &string)
 Validates that string starts with a specific item.
 
static void starts_with (const xtd::ustring &item, const xtd::ustring &string, const xtd::diagnostics::stack_frame &stack_frame)
 Validates that string starts with item.
 
static void starts_with (const xtd::ustring &item, const xtd::ustring &string, const xtd::ustring &message)
 Validates that string starts with item.
 
static void starts_with (const xtd::ustring &item, const xtd::ustring &string, const xtd::ustring &message, const xtd::diagnostics::stack_frame &stack_frame)
 Validates that string starts with item.
 

Member Function Documentation

◆ are_equal_ignoring_case() [1/4]

static void xtd::tunit::string_assume::are_equal_ignoring_case ( const xtd::ustring expected,
const xtd::ustring actual 
)
inlinestatic

Validates that two type are equal ignoring case.

Parameters
expectedthe expected value.
actualthe actual value.
Exceptions
xtd::tunit::abort_errorIf bad assertion.
Examples
xtd::tunit::string_assume::are_equal_ignoring_case("key", xtd::ustring("VALUE")); // test throws an abort_error exception.
static void are_equal_ignoring_case(const xtd::ustring &expected, const xtd::ustring &actual)
Validates that two type are equal ignoring case.
Definition: string_assume.h:36
Represents text as a sequence of UTF-8 code units.
Definition: ustring.h:48

◆ are_equal_ignoring_case() [2/4]

static void xtd::tunit::string_assume::are_equal_ignoring_case ( const xtd::ustring expected,
const xtd::ustring actual,
const xtd::diagnostics::stack_frame stack_frame 
)
inlinestatic

Validates that two type are equal ignoring case.

Parameters
expectedthe expected value.
actualthe actual value.
stack_frameContains information about current file and current line.
Exceptions
xtd::tunit::abort_errorIf bad assertion.
Examples
xtd::tunit::string_assume::are_equal_ignoring_case("key", xtd::ustring("VALUE"), csf_); // test throws an abort_error exception.
#define csf_
Provides information about the current stack frame.
Definition: stack_frame.h:213

◆ are_equal_ignoring_case() [3/4]

static void xtd::tunit::string_assume::are_equal_ignoring_case ( const xtd::ustring expected,
const xtd::ustring actual,
const xtd::ustring message 
)
inlinestatic

Validates that two type are equal ignoring case.

Parameters
expectedthe expected value.
actualthe actual value.
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
Exceptions
xtd::tunit::abort_errorIf bad assertion.
Examples
xtd::tunit::string_assume::are_equal_ignoring_case("value", xtd::ustring("VALUE"), "User message..."); // test ok.
xtd::tunit::string_assume::are_equal_ignoring_case("key", xtd::ustring("VALUE"), "User message..."); // test throws an abort_error exception.

◆ are_equal_ignoring_case() [4/4]

static void xtd::tunit::string_assume::are_equal_ignoring_case ( const xtd::ustring expected,
const xtd::ustring actual,
const xtd::ustring message,
const xtd::diagnostics::stack_frame stack_frame 
)
inlinestatic

Validates that two type are equal ignoring case.

Parameters
expectedthe expected value.
actualthe actual value.
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
stack_frameContains information about current file and current line.
Exceptions
xtd::tunit::abort_errorIf bad assertion.
Examples
xtd::tunit::string_assume::are_equal_ignoring_case("value", xtd::ustring("VALUE"), "User message...", csf_); // test ok.
xtd::tunit::string_assume::are_equal_ignoring_case("key", xtd::ustring("VALUE"), "User message...", csf_); // test throws an abort_error exception.

◆ are_not_equal_ignoring_case() [1/4]

static void xtd::tunit::string_assume::are_not_equal_ignoring_case ( const xtd::ustring expected,
const xtd::ustring actual 
)
inlinestatic

Validates that two type are not equal ignoring case.

Parameters
expectedthe expected value.
actualthe actual value.
Exceptions
xtd::tunit::abort_errorIf bad assertion.
Examples
xtd::tunit::string_assume::are_not_equal_ignoring_case("value", xtd::ustring("VALUE")); // test throws an abort_error exception.
static void are_not_equal_ignoring_case(const xtd::ustring &expected, const xtd::ustring &actual)
Validates that two type are not equal ignoring case.
Definition: string_assume.h:90

◆ are_not_equal_ignoring_case() [2/4]

static void xtd::tunit::string_assume::are_not_equal_ignoring_case ( const xtd::ustring expected,
const xtd::ustring actual,
const xtd::diagnostics::stack_frame stack_frame 
)
inlinestatic

Validates that two type are not equal ignoring case.

Parameters
expectedthe expected value.
actualthe actual value.
stack_frameContains information about current file and current line.
Exceptions
xtd::tunit::abort_errorIf bad assertion.
Examples
xtd::tunit::string_assume::are_not_equal_ignoring_case("value", xtd::ustring("VALUE"), csf_); // test throws an abort_error exception.

◆ are_not_equal_ignoring_case() [3/4]

static void xtd::tunit::string_assume::are_not_equal_ignoring_case ( const xtd::ustring expected,
const xtd::ustring actual,
const xtd::ustring message 
)
inlinestatic

Validates that two type are not equal ignoring case.

Parameters
expectedthe expected value.
actualthe actual value.
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
Exceptions
xtd::tunit::abort_errorIf bad assertion.
Examples
xtd::tunit::string_assume::are_not_equal_ignoring_case("key", xtd::ustring("VALUE"), "User message..."); // test ok.
xtd::tunit::string_assume::are_not_equal_ignoring_case("value", xtd::ustring("VALUE"), "User message..."); // test throws an abort_error exception.

◆ are_not_equal_ignoring_case() [4/4]

static void xtd::tunit::string_assume::are_not_equal_ignoring_case ( const xtd::ustring expected,
const xtd::ustring actual,
const xtd::ustring message,
const xtd::diagnostics::stack_frame stack_frame 
)
inlinestatic

Validates that two type are not equal ignoring case.

Parameters
expectedthe expected value.
actualthe actual value.
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
stack_frameContains information about current file and current line.
Exceptions
xtd::tunit::abort_errorIf bad assertion.
Examples
xtd::tunit::string_assume::are_not_equal_ignoring_case("key", xtd::ustring("VALUE"), "User message...", csf_); // test ok.
xtd::tunit::string_assume::are_not_equal_ignoring_case("value", xtd::ustring("VALUE"), "User message...", csf_); // test throws an abort_error exception.

◆ contains() [1/4]

static void xtd::tunit::string_assume::contains ( const xtd::ustring item,
const xtd::ustring string 
)
inlinestatic

Validates that string contains an item.

Parameters
itemobject to verify.
collectionthat contains object.
Exceptions
xtd::tunit::abort_errorIf bad assertion.
Examples
xtd::ustring s = "value";
xtd::tunit::string_assume::contains("z", s); // test throws an abort_error exception.
static void contains(const xtd::ustring &item, const xtd::ustring &string)
Validates that string contains an item.
Definition: string_assume.h:145
@ s
The S key.

◆ contains() [2/4]

static void xtd::tunit::string_assume::contains ( const xtd::ustring item,
const xtd::ustring string,
const xtd::diagnostics::stack_frame stack_frame 
)
inlinestatic

Validates that string contains an item.

Parameters
itemobject to verify.
collectionthat contains object.
stack_frameContains information about current file and current line.
Exceptions
xtd::tunit::abort_errorIf bad assertion.
Examples
xtd::ustring s = "value";
xtd::tunit::string_assume::contains("z", s, csf_); // test throws an abort_error exception.

◆ contains() [3/4]

static void xtd::tunit::string_assume::contains ( const xtd::ustring item,
const xtd::ustring string,
const xtd::ustring message 
)
inlinestatic

Validates that string contains an item.

Parameters
itemobject to verify.
collectionthat contains object.
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
Exceptions
xtd::tunit::abort_errorIf bad assertion.
Examples
xtd::ustring s = "value";
xtd::tunit::string_assume::contains("a", s, "User message..."); // test ok.
xtd::tunit::string_assume::contains("z", s, "User message..."); // test throws an abort_error exception.

◆ contains() [4/4]

static void xtd::tunit::string_assume::contains ( const xtd::ustring item,
const xtd::ustring string,
const xtd::ustring message,
const xtd::diagnostics::stack_frame stack_frame 
)
inlinestatic

Validates that string contains an item.

Parameters
itemobject to verify.
collectionthat contains object.
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
stack_frameContains information about current file and current line.
Exceptions
xtd::tunit::abort_errorIf bad assertion.
Examples
xtd::ustring s = "value";
xtd::tunit::string_assume::contains("a", s, "User message...", csf_); // test ok.
xtd::tunit::string_assume::contains("z", s, "User message...", csf_); // test throws an abort_error exception.

◆ does_not_contain() [1/4]

static void xtd::tunit::string_assume::does_not_contain ( const xtd::ustring item,
const xtd::ustring string 
)
inlinestatic

Validates that string contains an item.

Parameters
itemobject to verify.
collectionthat contains object.
Exceptions
xtd::tunit::abort_errorIf bad assertion.
Examples
xtd::ustring s = "value";
xtd::tunit::string_assume::contains("z", s); // test throws an abort_error exception.

◆ does_not_contain() [2/4]

static void xtd::tunit::string_assume::does_not_contain ( const xtd::ustring item,
const xtd::ustring string,
const xtd::diagnostics::stack_frame stack_frame 
)
inlinestatic

Validates that string contains an item.

Parameters
itemobject to verify.
collectionthat contains object.
stack_frameContains information about current file and current line.
Exceptions
xtd::tunit::abort_errorIf bad assertion.
Examples
xtd::ustring s = "value";
xtd::tunit::string_assume::contains("z", s, csf_); // test throws an abort_error exception.

◆ does_not_contain() [3/4]

static void xtd::tunit::string_assume::does_not_contain ( const xtd::ustring item,
const xtd::ustring string,
const xtd::ustring message 
)
inlinestatic

Validates that string contains an item.

Parameters
itemobject to verify.
collectionthat contains object.
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
Exceptions
xtd::tunit::abort_errorIf bad assertion.
Examples
xtd::ustring s = "value";
xtd::tunit::string_assume::contains("a", s, "User message..."); // test ok.
xtd::tunit::string_assume::contains("z", s, "User message..."); // test throws an abort_error exception.

◆ does_not_contain() [4/4]

static void xtd::tunit::string_assume::does_not_contain ( const xtd::ustring item,
const xtd::ustring string,
const xtd::ustring message,
const xtd::diagnostics::stack_frame stack_frame 
)
inlinestatic

Validates that string contains an item.

Parameters
itemobject to verify.
collectionthat contains object.
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
stack_frameContains information about current file and current line.
Exceptions
xtd::tunit::abort_errorIf bad assertion.
Examples
xtd::ustring s = "value";
xtd::tunit::string_assume::contains("a", s, "User message...", csf_); // test ok.
xtd::tunit::string_assume::contains("z", s, "User message...", csf_); // test throws an abort_error exception.

◆ does_not_end_with() [1/4]

static void xtd::tunit::string_assume::does_not_end_with ( const xtd::ustring item,
const xtd::ustring string 
)
inlinestatic

Validates that string does not end with a specific item.

Parameters
itemobject to verify.
collectionthat contains object.
Exceptions
xtd::tunit::abort_errorIf bad assertion.
Examples
xtd::ustring s = "value";
xtd::tunit::string_assume::does_not_end_with("lue", s); // test throws an abort_error exception.
static void does_not_end_with(const xtd::ustring &item, const xtd::ustring &string)
Validates that string does not end with a specific item.
Definition: string_assume.h:435

◆ does_not_end_with() [2/4]

static void xtd::tunit::string_assume::does_not_end_with ( const xtd::ustring item,
const xtd::ustring string,
const xtd::diagnostics::stack_frame stack_frame 
)
inlinestatic

Validates that string starts with item.

Parameters
itemobject to verify.
collectionthat contains object.
stack_frameContains information about current file and current line.
Exceptions
xtd::tunit::abort_errorIf bad assertion.
Examples
xtd::ustring s = "value";
xtd::tunit::string_assume::does_not_end_with("lue", s, csf_); // test throws an abort_error exception.

◆ does_not_end_with() [3/4]

static void xtd::tunit::string_assume::does_not_end_with ( const xtd::ustring item,
const xtd::ustring string,
const xtd::ustring message 
)
inlinestatic

Validates that string starts with item.

Parameters
itemobject to verify.
collectionthat contains object.
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
Exceptions
xtd::tunit::abort_errorIf bad assertion.
Examples
xtd::ustring s = "value";
xtd::tunit::string_assume::does_not_end_with("law", s, "User message..."); // test ok.
xtd::tunit::string_assume::does_not_end_with("lue", s, "User message..."); // test throws an abort_error exception.

◆ does_not_end_with() [4/4]

static void xtd::tunit::string_assume::does_not_end_with ( const xtd::ustring item,
const xtd::ustring string,
const xtd::ustring message,
const xtd::diagnostics::stack_frame stack_frame 
)
inlinestatic

Validates that string starts with item.

Parameters
itemobject to verify.
collectionthat contains object.
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
stack_frameContains information about current file and current line.
Exceptions
xtd::tunit::abort_errorIf bad assertion.
Examples
xtd::ustring s = "value";
xtd::tunit::string_assume::does_not_end_with("law", s, "User message...", csf_); // test ok.
xtd::tunit::string_assume::does_not_end_with("lue", s, "User message...", csf_); // test throws an abort_error exception.

◆ does_not_match() [1/4]

static void xtd::tunit::string_assume::does_not_match ( const xtd::ustring regex_pattern,
const xtd::ustring actual 
)
inlinestatic

Validates that does not match regex pattern.

Parameters
regex_patternthe regex pattern.
actualthe actual value.
Exceptions
xtd::tunit::abort_errorIf bad assertion.
Examples
xtd::tunit::string_assume::does_not_match("^Salut", xtd::ustring("Hello, World!")); // test ok.
xtd::tunit::string_assume::does_not_match("^Hello", xtd::ustring("Hello, World!")); // test throws an abort_error exception.
static void does_not_match(const xtd::ustring &regex_pattern, const xtd::ustring &actual)
Validates that does not match regex pattern.
Definition: string_assume.h:546

◆ does_not_match() [2/4]

static void xtd::tunit::string_assume::does_not_match ( const xtd::ustring regex_pattern,
const xtd::ustring actual,
const xtd::diagnostics::stack_frame stack_frame 
)
inlinestatic

Validates that does not match regex pattern.

Parameters
regex_patternthe regex pattern.
actualthe actual value.
stack_frameContains information about current file and current line.
Exceptions
xtd::tunit::abort_errorIf bad assertion.
Examples
xtd::tunit::string_assume::does_not_match("^Salut", xtd::ustring("Hello, World!"), csf_); // test ok.
xtd::tunit::string_assume::does_not_match("^Hello", xtd::ustring("Hello, World!"), csf_); // test throws an abort_error exception.

◆ does_not_match() [3/4]

static void xtd::tunit::string_assume::does_not_match ( const xtd::ustring regex_pattern,
const xtd::ustring actual,
const xtd::ustring message 
)
inlinestatic

Validates that does not match regex pattern.

Parameters
regex_patternthe regex pattern.
actualthe actual value.
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
Exceptions
xtd::tunit::abort_errorIf bad assertion.
Examples
xtd::tunit::string_assume::does_not_match("^Salut", xtd::ustring("Hello, World!"), "User message..."); // test ok.
xtd::tunit::string_assume::does_not_match("^Hello", xtd::ustring("Hello, World!"), "User message..."); // test throws an abort_error exception.

◆ does_not_match() [4/4]

static void xtd::tunit::string_assume::does_not_match ( const xtd::ustring regex_pattern,
const xtd::ustring actual,
const xtd::ustring message,
const xtd::diagnostics::stack_frame stack_frame 
)
inlinestatic

Validates that does not match regex pattern.

Parameters
regex_patternthe regex pattern.
actualthe actual value.
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
stack_frameContains information about current file and current line.
Exceptions
xtd::tunit::abort_errorIf bad assertion.
Examples
xtd::tunit::string_assume::does_not_match("^Salut", "Hello, World!", xtd::ustring("User message..."), csf_); // test ok.
xtd::tunit::string_assume::does_not_match("^Hello", "Hello, World!", xtd::ustring("User message..."), csf_); // test throws an abort_error exception.

◆ does_not_start_with() [1/4]

static void xtd::tunit::string_assume::does_not_start_with ( const xtd::ustring item,
const xtd::ustring string 
)
inlinestatic

Validates that string does not start with a specific item.

Parameters
itemobject to verify.
collectionthat contains object.
Exceptions
xtd::tunit::abort_errorIf bad assertion.
Examples
xtd::ustring s = "value";
xtd::tunit::string_assume::does_not_start_with("val", s); // test throws an abort_error exception.
static void does_not_start_with(const xtd::ustring &item, const xtd::ustring &string)
Validates that string does not start with a specific item.
Definition: string_assume.h:319

◆ does_not_start_with() [2/4]

static void xtd::tunit::string_assume::does_not_start_with ( const xtd::ustring item,
const xtd::ustring string,
const xtd::diagnostics::stack_frame stack_frame 
)
inlinestatic

Validates that string starts with item.

Parameters
itemobject to verify.
collectionthat contains object.
stack_frameContains information about current file and current line.
Exceptions
xtd::tunit::abort_errorIf bad assertion.
Examples
xtd::ustring s = "value";
xtd::tunit::string_assume::does_not_start_with("val", s, csf_); // test throws an abort_error exception.

◆ does_not_start_with() [3/4]

static void xtd::tunit::string_assume::does_not_start_with ( const xtd::ustring item,
const xtd::ustring string,
const xtd::ustring message 
)
inlinestatic

Validates that string starts with item.

Parameters
itemobject to verify.
collectionthat contains object.
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
Exceptions
xtd::tunit::abort_errorIf bad assertion.
Examples
xtd::ustring s = "value";
xtd::tunit::string_assume::does_not_start_with("zoe", s, "User message..."); // test ok.
xtd::tunit::string_assume::does_not_start_with("val", s, "User message..."); // test throws an abort_error exception.

◆ does_not_start_with() [4/4]

static void xtd::tunit::string_assume::does_not_start_with ( const xtd::ustring item,
const xtd::ustring string,
const xtd::ustring message,
const xtd::diagnostics::stack_frame stack_frame 
)
inlinestatic

Validates that string starts with item.

Parameters
itemobject to verify.
collectionthat contains object.
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
stack_frameContains information about current file and current line.
Exceptions
xtd::tunit::abort_errorIf bad assertion.
Examples
xtd::ustring s = "value";
xtd::tunit::string_assume::does_not_start_with("zoe", s, "User message...", csf_); // test ok.
xtd::tunit::string_assume::does_not_start_with("val", s, "User message...", csf_); // test throws an abort_error exception.

◆ ends_with() [1/4]

static void xtd::tunit::string_assume::ends_with ( const xtd::ustring item,
const xtd::ustring string 
)
inlinestatic

Validates that string ends with a specific item.

Parameters
itemobject to verify.
collectionthat contains object.
Exceptions
xtd::tunit::abort_errorIf bad assertion.
Examples
xtd::ustring s = "value";
xtd::tunit::string_assume::ends_with("law", s); // test throws an abort_error exception.
static void ends_with(const xtd::ustring &item, const xtd::ustring &string)
Validates that string ends with a specific item.
Definition: string_assume.h:377

◆ ends_with() [2/4]

static void xtd::tunit::string_assume::ends_with ( const xtd::ustring item,
const xtd::ustring string,
const xtd::diagnostics::stack_frame stack_frame 
)
inlinestatic

Validates that string starts with item.

Parameters
itemobject to verify.
collectionthat contains object.
stack_frameContains information about current file and current line.
Exceptions
xtd::tunit::abort_errorIf bad assertion.
Examples
xtd::ustring s = "value";
xtd::tunit::string_assume::ends_with("law", s, csf_); // test throws an abort_error exception.

◆ ends_with() [3/4]

static void xtd::tunit::string_assume::ends_with ( const xtd::ustring item,
const xtd::ustring string,
const xtd::ustring message 
)
inlinestatic

Validates that string starts with item.

Parameters
itemobject to verify.
collectionthat contains object.
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
Exceptions
xtd::tunit::abort_errorIf bad assertion.
Examples
xtd::ustring s = "value";
xtd::tunit::string_assume::ends_with("val", s, "User message..."); // test ok.
xtd::tunit::string_assume::ends_with("law", s, "User message..."); // test throws an abort_error exception.

◆ ends_with() [4/4]

static void xtd::tunit::string_assume::ends_with ( const xtd::ustring item,
const xtd::ustring string,
const xtd::ustring message,
const xtd::diagnostics::stack_frame stack_frame 
)
inlinestatic

Validates that string starts with item.

Parameters
itemobject to verify.
collectionthat contains object.
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
stack_frameContains information about current file and current line.
Exceptions
xtd::tunit::abort_errorIf bad assertion.
Examples
xtd::ustring s = "value";
xtd::tunit::string_assume::ends_with("lue", s, "User message...", csf_); // test ok.
xtd::tunit::string_assume::ends_with("law", s, "User message...", csf_); // test throws an abort_error exception.

◆ matches() [1/4]

static void xtd::tunit::string_assume::matches ( const xtd::ustring regex_pattern,
const xtd::ustring actual 
)
inlinestatic

Validates that matches regex pattern.

Parameters
regex_patternthe regex pattern.
actualthe actual value.
Exceptions
xtd::tunit::abort_errorIf bad assertion.
Examples
xtd::tunit::string_assume::matches("^Hello", xtd::ustring("Hello, World!")); // test ok.
xtd::tunit::string_assume::matches("^Salut", xtd::ustring("Hello, World!")); // test throws an abort_error exception.
static void matches(const xtd::ustring &regex_pattern, const xtd::ustring &actual)
Validates that matches regex pattern.
Definition: string_assume.h:492

◆ matches() [2/4]

static void xtd::tunit::string_assume::matches ( const xtd::ustring regex_pattern,
const xtd::ustring actual,
const xtd::diagnostics::stack_frame stack_frame 
)
inlinestatic

Validates that matches regex pattern.

Parameters
regex_patternthe regex pattern.
actualthe actual value.
stack_frameContains information about current file and current line.
Exceptions
xtd::tunit::abort_errorIf bad assertion.
Examples
xtd::tunit::string_assume::matches("^Hello", xtd::ustring("Hello, World!"), csf_); // test ok.
xtd::tunit::string_assume::matches("^Salut", xtd::ustring("Hello, World!"), csf_); // test throws an abort_error exception.

◆ matches() [3/4]

static void xtd::tunit::string_assume::matches ( const xtd::ustring regex_pattern,
const xtd::ustring actual,
const xtd::ustring message 
)
inlinestatic

Validates that matches regex pattern.

Parameters
regex_patternthe regex pattern.
actualthe actual value.
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
Exceptions
xtd::tunit::abort_errorIf bad assertion.
Examples
xtd::tunit::string_assume::matches("^Hello", xtd::ustring("Hello, World!"), "User message..."); // test ok.
xtd::tunit::string_assume::matches("^Salut", xtd::ustring("Hello, World!"), "User message..."); // test throws an abort_error exception.

◆ matches() [4/4]

static void xtd::tunit::string_assume::matches ( const xtd::ustring regex_pattern,
const xtd::ustring actual,
const xtd::ustring message,
const xtd::diagnostics::stack_frame stack_frame 
)
inlinestatic

Validates that matches regex pattern.

Parameters
regex_patternthe regex pattern.
actualthe actual value.
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
stack_frameContains information about current file and current line.
Exceptions
xtd::tunit::abort_errorIf bad assertion.
Examples
xtd::tunit::string_assume::matches("^Hello", "Hello, World!", xtd::ustring("User message..."), csf_); // test ok.
xtd::tunit::string_assume::matches("^Salut", "Hello, World!", xtd::ustring("User message..."), csf_); // test throws an abort_error exception.

◆ starts_with() [1/4]

static void xtd::tunit::string_assume::starts_with ( const xtd::ustring item,
const xtd::ustring string 
)
inlinestatic

Validates that string starts with a specific item.

Parameters
itemobject to verify.
collectionthat contains object.
Exceptions
xtd::tunit::abort_errorIf bad assertion.
Examples
xtd::ustring s = "value";
xtd::tunit::string_assume::starts_with("zoe", s); // test throws an abort_error exception.
static void starts_with(const xtd::ustring &item, const xtd::ustring &string)
Validates that string starts with a specific item.
Definition: string_assume.h:261

◆ starts_with() [2/4]

static void xtd::tunit::string_assume::starts_with ( const xtd::ustring item,
const xtd::ustring string,
const xtd::diagnostics::stack_frame stack_frame 
)
inlinestatic

Validates that string starts with item.

Parameters
itemobject to verify.
collectionthat contains object.
stack_frameContains information about current file and current line.
Exceptions
xtd::tunit::abort_errorIf bad assertion.
Examples
xtd::ustring s = "value";
xtd::tunit::string_assume::starts_with("zoe", s, csf_); // test throws an abort_error exception.

◆ starts_with() [3/4]

static void xtd::tunit::string_assume::starts_with ( const xtd::ustring item,
const xtd::ustring string,
const xtd::ustring message 
)
inlinestatic

Validates that string starts with item.

Parameters
itemobject to verify.
collectionthat contains object.
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
Exceptions
xtd::tunit::abort_errorIf bad assertion.
Examples
xtd::ustring s = "value";
xtd::tunit::string_assume::starts_with("val", s, "User message..."); // test ok.
xtd::tunit::string_assume::starts_with("zoe", s, "User message..."); // test throws an abort_error exception.

◆ starts_with() [4/4]

static void xtd::tunit::string_assume::starts_with ( const xtd::ustring item,
const xtd::ustring string,
const xtd::ustring message,
const xtd::diagnostics::stack_frame stack_frame 
)
inlinestatic

Validates that string starts with item.

Parameters
itemobject to verify.
collectionthat contains object.
messageA user message to display if the assertion fails. This message can be seen in the unit test results.
stack_frameContains information about current file and current line.
Exceptions
xtd::tunit::abort_errorIf bad assertion.
Examples
xtd::ustring s = "value";
xtd::tunit::string_assume::starts_with("val", s, "User message...", csf_); // test ok.
xtd::tunit::string_assume::starts_with("zoe", s, "User message...", csf_); // test throws an abort_error exception.

The documentation for this class was generated from the following file: