#include <directory_assert.h>
The directory_assert class contains a collection of static methods that implement the most directory 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>
namespace unit_tests {
class test_class_(test) {
public:
void test_method_(test_case1) {
}
void test_method_(test_case2) {
}
void test_method_(test_case3) {
}
};
}
int main() {
return console_unit_test().run();
}
static void is_false(bool condition)
Asserts that ta condition is false.
Definition: assert.h:884
static void is_true(bool condition)
Asserts that ta condition is true.
Definition: assert.h:2489
static void does_not_throw(const std::function< void()> &statement)
Asserts that the staement does not throw an exception.
Definition: assert.h:709
The tunit namespace contains a unit test library.
Definition: abort_error.h:11
Inherits xtd::tunit::base_assert.
|
template<typename Char > |
static void | does_not_exist (const std::basic_string< Char > &directory) |
| Asserts that file not exists. More...
|
|
template<typename Char > |
static void | does_not_exist (const std::basic_string< Char > &directory, const std::string &message) |
| Asserts that file not exists. More...
|
|
template<typename Char > |
static void | does_not_exist (const std::basic_string< Char > &directory, const std::string &message, const xtd::diagnostics::stack_frame &stack_frame) |
| Asserts that file not exists. More...
|
|
template<typename Char > |
static void | does_not_exist (const std::basic_string< Char > &directory, const xtd::diagnostics::stack_frame &stack_frame) |
| Asserts that file not exists. More...
|
|
template<typename Char > |
static void | exists (const std::basic_string< Char > &directory) |
| Asserts that directory exists. More...
|
|
template<typename Char > |
static void | exists (const std::basic_string< Char > &directory, const std::string &message) |
| Asserts that directory exists. More...
|
|
template<typename Char > |
static void | exists (const std::basic_string< Char > &directory, const std::string &message, const xtd::diagnostics::stack_frame &stack_frame) |
| Asserts that directory exists. More...
|
|
template<typename Char > |
static void | exists (const std::basic_string< Char > &directory, const xtd::diagnostics::stack_frame &stack_frame) |
| Asserts that directory exists. More...
|
|
◆ does_not_exist() [1/4]
template<typename Char >
static void xtd::tunit::directory_assert::does_not_exist |
( |
const std::basic_string< Char > & |
directory | ) |
|
|
inlinestatic |
Asserts that file not exists.
- Parameters
-
expected | the expected value. |
actual | the actual value. |
- Exceptions
-
xtd::tunit::assertion_error | If bad assertion. |
- Examples
std::ifstream
f1(
"Test1.txt");
static void does_not_exist(const std::basic_string< Char > &file)
Asserts that file not exists.
Definition: file_assert.h:552
◆ does_not_exist() [2/4]
template<typename Char >
static void xtd::tunit::directory_assert::does_not_exist |
( |
const std::basic_string< Char > & |
directory, |
|
|
const std::string & |
message |
|
) |
| |
|
inlinestatic |
Asserts that file not exists.
- Parameters
-
expected | the expected value. |
actual | the actual value. |
message | A user message to display if the assertion fails. This message can be seen in the unit test results. |
- Exceptions
-
xtd::tunit::assertion_error | If bad assertion. |
- Examples
std::ifstream
f1(
"Test1.txt");
◆ does_not_exist() [3/4]
template<typename Char >
static void xtd::tunit::directory_assert::does_not_exist |
( |
const std::basic_string< Char > & |
directory, |
|
|
const std::string & |
message, |
|
|
const xtd::diagnostics::stack_frame & |
stack_frame |
|
) |
| |
|
inlinestatic |
Asserts that file not exists.
- Parameters
-
expected | the expected value. |
actual | the actual value. |
message | A user message to display if the assertion fails. This message can be seen in the unit test results. |
stack_frame | Contains information about current file and current line. |
- Exceptions
-
xtd::tunit::assertion_error | If bad assertion. |
- Examples
std::ifstream
f1(
"Test1.txt");
#define csf_
Provides information about the current stack frame.
Definition: stack_frame.h:213
◆ does_not_exist() [4/4]
template<typename Char >
static void xtd::tunit::directory_assert::does_not_exist |
( |
const std::basic_string< Char > & |
directory, |
|
|
const xtd::diagnostics::stack_frame & |
stack_frame |
|
) |
| |
|
inlinestatic |
Asserts that file not exists.
- Parameters
-
expected | the expected value. |
actual | the actual value. |
stack_frame | Contains information about current file and current line. |
- Exceptions
-
xtd::tunit::assertion_error | If bad assertion. |
- Examples
std::ifstream
f1(
"Test1.txt");
◆ exists() [1/4]
template<typename Char >
static void xtd::tunit::directory_assert::exists |
( |
const std::basic_string< Char > & |
directory | ) |
|
|
inlinestatic |
Asserts that directory exists.
- Parameters
-
expected | the expected value. |
actual | the actual value. |
- Exceptions
-
xtd::tunit::assertion_error | If bad assertion. |
- Examples
std::ifstream
f1(
"Test1.txt");
static void exists(const std::basic_string< Char > &file)
Asserts that file exists.
Definition: file_assert.h:476
◆ exists() [2/4]
template<typename Char >
static void xtd::tunit::directory_assert::exists |
( |
const std::basic_string< Char > & |
directory, |
|
|
const std::string & |
message |
|
) |
| |
|
inlinestatic |
Asserts that directory exists.
- Parameters
-
expected | the expected value. |
actual | the actual value. |
message | A user message to display if the assertion fails. This message can be seen in the unit test results. |
- Exceptions
-
xtd::tunit::assertion_error | If bad assertion. |
- Examples
std::ifstream
f1(
"Test1.txt");
◆ exists() [3/4]
template<typename Char >
static void xtd::tunit::directory_assert::exists |
( |
const std::basic_string< Char > & |
directory, |
|
|
const std::string & |
message, |
|
|
const xtd::diagnostics::stack_frame & |
stack_frame |
|
) |
| |
|
inlinestatic |
Asserts that directory exists.
- Parameters
-
expected | the expected value. |
actual | the actual value. |
message | A user message to display if the assertion fails. This message can be seen in the unit test results. |
stack_frame | Contains information about current file and current line. |
- Exceptions
-
xtd::tunit::assertion_error | If bad assertion. |
- Examples
std::ifstream
f1(
"Test1.txt");
◆ exists() [4/4]
template<typename Char >
static void xtd::tunit::directory_assert::exists |
( |
const std::basic_string< Char > & |
directory, |
|
|
const xtd::diagnostics::stack_frame & |
stack_frame |
|
) |
| |
|
inlinestatic |
Asserts that directory exists.
- Parameters
-
expected | the expected value. |
actual | the actual value. |
stack_frame | Contains information about current file and current line. |
- Exceptions
-
xtd::tunit::assertion_error | If bad assertion. |
- Examples
std::ifstream
f1(
"Test1.txt");
The documentation for this class was generated from the following file: