#include <directory_valid.h>
The directory_valid 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) {
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() {
}
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.
|
template<typename Char > |
static void | does_not_exist (const std::basic_string< Char > &directory) |
| Asserts that file not exists.
|
|
template<typename Char > |
static void | does_not_exist (const std::basic_string< Char > &directory, const std::string &message) |
| Asserts that file not exists.
|
|
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.
|
|
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.
|
|
template<typename Char > |
static void | exists (const std::basic_string< Char > &directory) |
| Asserts that directory exists.
|
|
template<typename Char > |
static void | exists (const std::basic_string< Char > &directory, const std::string &message) |
| Asserts that directory exists.
|
|
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.
|
|
template<typename Char > |
static void | exists (const std::basic_string< Char > &directory, const xtd::diagnostics::stack_frame &stack_frame) |
| Asserts that directory exists.
|
|
◆ does_not_exist() [1/4]
template<typename Char >
static void xtd::tunit::directory_valid::does_not_exist |
( |
const std::basic_string< Char > & |
directory | ) |
|
|
inlinestatic |
Asserts that file not exists.
- Parameters
-
expected | the expected value. |
actual | the actual value. |
- 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_valid::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. |
- Examples
std::ifstream
f1(
"Test1.txt");
◆ does_not_exist() [3/4]
template<typename Char >
static void xtd::tunit::directory_valid::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. |
- 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_valid::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. |
- Examples
std::ifstream
f1(
"Test1.txt");
◆ exists() [1/4]
template<typename Char >
static void xtd::tunit::directory_valid::exists |
( |
const std::basic_string< Char > & |
directory | ) |
|
|
inlinestatic |
Asserts that directory exists.
- Parameters
-
expected | the expected value. |
actual | the actual value. |
- 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_valid::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. |
- Examples
std::ifstream
f1(
"Test1.txt");
◆ exists() [3/4]
template<typename Char >
static void xtd::tunit::directory_valid::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. |
- Examples
std::ifstream
f1(
"Test1.txt");
◆ exists() [4/4]
template<typename Char >
static void xtd::tunit::directory_valid::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. |
- Examples
std::ifstream
f1(
"Test1.txt");
The documentation for this class was generated from the following file: