The file_assert class contains a collection of static methods that implement the most file 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) {
auto fn = path::get_temp_file_name();
file_assert::exists(fn);
file::remove(fn);
}
auto fn = path::get_random_file_name();
file_assert::exists(fn);
}
auto is = std::istringstream {
"xtd::tunit::file_assert::are_equal example."};
file_assert::are_equal(std::istringstream {
"xtd::tunit::file_assert::are_equel example."},
is);
}
};
}
auto main() -> int {
}
The console_unit_test class is console unit test interface.
Definition console_unit_test.hpp:23
int32 run() noexcept
Runs all tests in this unit_test object and prints the result.
#define test_method_(method_name)
Add test method to class test.
Definition test_method_attribute.hpp:73
bool is(std::any value)
Checks if the result of an expression is compatible with a given type.
Definition is.hpp:365
The xtd::io namespace contains types that allow reading and writing to files and data streams,...
Definition binary_reader.hpp:16
The tunit namespace contains a unit test library.
Definition abort_error.hpp:10
|
template<typename char_t > |
static void | are_equal (const std::basic_istream< char_t > &expected, const std::basic_istream< char_t > &actual, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) |
| Asserts that two files are equal.
|
|
template<typename char_t > |
static void | are_equal (const std::basic_istream< char_t > &expected, const std::basic_istream< char_t > &actual, const std::string &message, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) |
| Asserts that two files are equal.
|
|
template<typename char_t > |
static void | are_equal (const xtd::basic_string< char_t > &expected, const xtd::basic_string< char_t > &actual, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) |
| Asserts that two files are equal.
|
|
template<typename char_t > |
static void | are_equal (const xtd::basic_string< char_t > &expected, const xtd::basic_string< char_t > &actual, const std::string &message, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) |
| Asserts that two files are equal.
|
|
template<typename char_t > |
static void | are_not_equal (const std::basic_istream< char_t > &expected, const std::basic_istream< char_t > &actual, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) |
| Asserts that two files are not equal.
|
|
template<typename char_t > |
static void | are_not_equal (const std::basic_istream< char_t > &expected, const std::basic_istream< char_t > &actual, const std::string &message, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) |
| Asserts that two files are not equal.
|
|
template<typename char_t > |
static void | are_not_equal (const xtd::basic_string< char_t > &expected, const xtd::basic_string< char_t > &actual, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) |
| Asserts that two files are not equal.
|
|
template<typename char_t > |
static void | are_not_equal (const xtd::basic_string< char_t > &expected, const xtd::basic_string< char_t > &actual, const std::string &message, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) |
| Asserts that two files are not equal.
|
|
template<typename char_t > |
static void | does_not_exist (const xtd::basic_string< char_t > &file, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) |
| Asserts that file not exists.
|
|
template<typename char_t > |
static void | does_not_exist (const xtd::basic_string< char_t > &file, const std::string &message, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) |
| Asserts that file not exists.
|
|
template<typename char_t > |
static void | exists (const xtd::basic_string< char_t > &file, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) |
| Asserts that file exists.
|
|
template<typename char_t > |
static void | exists (const xtd::basic_string< char_t > &file, const std::string &message, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current()) |
| Asserts that file exists.
|
|