xtd 0.2.0
Loading...
Searching...
No Matches
xtd::tunit::constraints::does_not_value< actual_t > Class Template Reference
Inheritance diagram for xtd::tunit::constraints::does_not_value< actual_t >:
xtd::tunit::constraints::actual_value< actual_t >

Public Methods

template<class expected_t>
auto end_with (const expected_t &expected, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) const
 Asserts that string ends with specified expected value.
 
template<class expected_t>
auto end_with (const expected_t &expected, const xtd::string &message, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) const
 Asserts that string ends with specified expected value and specified user message.
 
template<class expected_t>
auto start_with (const expected_t &expected, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) const
 Asserts that string starts with specified item.
 
template<class expected_t>
auto start_with (const expected_t &expected, const xtd::string &message, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) const
 Asserts that string starts with specified item and specified user message.
 

Protected Construtors

 does_not_value (actual_value< actual_t > &&v)
 
 does_not_value (const actual_value< actual_t > &v)
 

Additional Inherited Members

 actual_value (actual_value &&)=default
 
 actual_value (const actual_value &)=default
 
xtd::tunit::constraints::assert_type assert_type () const noexcept
 
actual_valuetype (xtd::tunit::constraints::assert_type assert_type) noexcept
 
auto is_assert () const noexcept
 
auto is_valid () const noexcept
 
auto is_assume () const noexcept
 
const actual_t & actual () const noexcept
 
actual_valueactual (const actual_t &actual) noexcept
 

Member Function Documentation

◆ end_with() [1/2]

template<class actual_t>
template<class expected_t>
auto xtd::tunit::constraints::does_not_value< actual_t >::end_with ( const expected_t & expected,
const xtd::diagnostics::stack_frame & stack_frame = xtd::diagnostics::stack_frame::current() ) const
inline

Asserts that string ends with specified expected value.

Parameters
itemobject to verify.
stack_frameContains information about current file and current line.
Exceptions
xtd::tunit::assert_errorIf bad assertion.
Examples
auto s = "value";
xtd::tunit::constraints::assert_that(s).does().not_().end_with("law"); // test ok.
xtd::tunit::constraints::assert_that(s).does().not_().end_with("val"); // test throws an assert_error exception.
@ s
The S key.
Definition console_key.hpp:124

◆ end_with() [2/2]

template<class actual_t>
template<class expected_t>
auto xtd::tunit::constraints::does_not_value< actual_t >::end_with ( const expected_t & expected,
const xtd::string & message,
const xtd::diagnostics::stack_frame & stack_frame = xtd::diagnostics::stack_frame::current() ) const
inline

Asserts that string ends with specified expected value and specified user message.

Parameters
itemobject to verify.
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::assert_errorIf bad assertion.
Examples
auto s = "value";
xtd::tunit::constraints::assert_that(s).does().not_().end_with("law", "User message..."); // test ok.
xtd::tunit::constraints::assert_that(s).does().not_().end_with("val", "User message..."); // test throws an assert_error exception.

◆ start_with() [1/2]

template<class actual_t>
template<class expected_t>
auto xtd::tunit::constraints::does_not_value< actual_t >::start_with ( const expected_t & expected,
const xtd::diagnostics::stack_frame & stack_frame = xtd::diagnostics::stack_frame::current() ) const
inline

Asserts that string starts with specified item.

Parameters
itemobject to verify.
stack_frameContains information about current file and current line.
Exceptions
xtd::tunit::assert_errorIf bad assertion.
Examples
xtd::string s = "value";
xtd::tunit::constraints::assert_that(s).does().not_().start_with("zoe"); // test ok.
xtd::tunit::constraints::assert_that(s).does().not_().start_with("val"); // test throws an assert_error exception.
xtd::basic_string< char > string
Represents text as a sequence of UTF-8 code units.
Definition __string_definitions.hpp:43

◆ start_with() [2/2]

template<class actual_t>
template<class expected_t>
auto xtd::tunit::constraints::does_not_value< actual_t >::start_with ( const expected_t & expected,
const xtd::string & message,
const xtd::diagnostics::stack_frame & stack_frame = xtd::diagnostics::stack_frame::current() ) const
inline

Asserts that string starts with specified item and specified user message.

Parameters
itemobject to verify.
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::assert_errorIf bad assertion.
Examples
xtd::string s = "value";
xtd::tunit::constraints::assert_that(s).does().not_().start_with("zoe", "User message..."); // test ok.
xtd::tunit::constraints::assert_that(s).does().not_().start_with("val", "User message..."); // test throws an assert_error exception.

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