xtd 0.2.0
Loading...
Searching...
No Matches
directory_assert.h
Go to the documentation of this file.
1
4#pragma once
5#include "assert.h"
6#define __XTD_STD_INTERNAL__
8#undef __XTD_STD_INTERNAL__
9#if defined(__xtd__cpp_lib_filesystem)
10#include <filesystem>
11#endif
12#include <xtd/io/directory>
13#include <xtd/io/directory_info>
14
16namespace xtd {
18 namespace tunit {
32 public:
34 directory_assert() = delete;
36
38
40 #if defined(__xtd__cpp_lib_filesystem)
54 static void are_equal(const std::filesystem::directory_entry& expected, const std::filesystem::directory_entry& actual, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current());
69 static void are_equal(const std::filesystem::directory_entry& expected, const std::filesystem::directory_entry& actual, const std::string& message, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current());
70 #endif
99 static void are_equal(const xtd::io::directory_info& expected, const xtd::io::directory_info& actual, const std::string& message, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current());
100
101 #if defined(__xtd__cpp_lib_filesystem)
115 static void are_not_equal(const std::filesystem::directory_entry& expected, const std::filesystem::directory_entry& actual, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current());
130 static void are_not_equal(const std::filesystem::directory_entry& expected, const std::filesystem::directory_entry& actual, const std::string& message, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current());
131 #endif
160 static void are_not_equal(const xtd::io::directory_info& expected, const xtd::io::directory_info& actual, const std::string& message, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current());
161
162 #if defined(__xtd__cpp_lib_filesystem)
175 static void does_not_exist(const std::filesystem::directory_entry& directory, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current());
189 static void does_not_exist(const std::filesystem::directory_entry& directory, const std::string& message, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current());
190 #endif
191
218 static void does_not_exist(const xtd::io::directory_info& directory, const std::string& message, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current());
219
232 template<typename char_t>
247 template<typename char_t>
248 static void does_not_exist(const xtd::basic_string<char_t>& directory, const std::string& message, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) {does_not_exist(xtd::io::directory_info(directory), message, stack_frame);}
249
251 template<typename char_t>
252 static void does_not_exist(const char_t* directory, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) {does_not_exist(directory, xtd::string::empty_string, stack_frame);}
253 template<typename char_t>
254 static void does_not_exist(const char_t* directory, const std::string& message, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) {does_not_exist(xtd::basic_string<char_t>(directory), message, stack_frame);}
256
257 #if defined(__xtd__cpp_lib_filesystem)
270 static void exists(const std::filesystem::directory_entry& directory, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current());
284 static void exists(const std::filesystem::directory_entry& directory, const std::string& message, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current());
285 #endif
286
313 static void exists(const xtd::io::directory_info& directory, const std::string& message, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current());
314
327 template<typename char_t>
342 template<typename char_t>
343 static void exists(const xtd::basic_string<char_t>& directory, const std::string& message, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) {exists(xtd::io::directory_info(directory), message, stack_frame);}
344
346 template<typename char_t>
347 static void exists(const char_t* directory, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) {exists(directory, xtd::string::empty_string, stack_frame);}
348 template<typename char_t>
349 static void exists(const char_t* directory, const std::string& message, const xtd::diagnostics::stack_frame& stack_frame = xtd::diagnostics::stack_frame::current()) {exists(xtd::basic_string<char_t>(directory), message, stack_frame);}
352 };
353 }
354}
Contains __xtd_std_version definitions.
Represents text as a sequence of character units.
Definition basic_string.h:79
static const basic_string empty_string
Represents the empty basic_string.
Definition basic_string.h:124
Provides information about a xtd::diagnostics::stack_frame, which represents a function call on the c...
Definition stack_frame.h:47
static stack_frame current(const xtd::source_location &value=xtd::source_location::current()) noexcept
Crates a new xtd::diagnostics::stack_frame object corresponding to the location of the call site.
Exposes instance methods for creating, moving, and enumerating through directories and subdirectories...
Definition directory_info.h:129
The base class for assert.
Definition base_assert.h:29
The directory_assert class contains a collection of static methods that implement the most directory ...
Definition directory_assert.h:31
static void are_equal(const xtd::io::directory_info &expected, const xtd::io::directory_info &actual, const std::string &message, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Asserts that two xtd::io::directory_info are equal.
static void are_not_equal(const xtd::io::directory_info &expected, const xtd::io::directory_info &actual, const std::string &message, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Asserts that two xtd::io::directory_info are not equal.
static void does_not_exist(const xtd::basic_string< char_t > &directory, const std::string &message, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Asserts that directory not exists.
Definition directory_assert.h:248
static void exists(const xtd::io::directory_info &directory, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Asserts that directory exists.
static void does_not_exist(const xtd::basic_string< char_t > &directory, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Asserts that directory not exists.
Definition directory_assert.h:233
static void exists(const xtd::basic_string< char_t > &directory, const std::string &message, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Asserts that directory exists.
Definition directory_assert.h:343
static void exists(const xtd::basic_string< char_t > &directory, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Asserts that directory exists.
Definition directory_assert.h:328
static void exists(const xtd::io::directory_info &directory, const std::string &message, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Asserts that directory exists.
static void are_not_equal(const xtd::io::directory_info &expected, const xtd::io::directory_info &actual, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Asserts that two xtd::io::directory_info are not equal.
static void are_equal(const xtd::io::directory_info &expected, const xtd::io::directory_info &actual, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Asserts that two xtd::io::directory_info are equal.
static void does_not_exist(const xtd::io::directory_info &directory, const std::string &message, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Asserts that directory not exists.
static void does_not_exist(const xtd::io::directory_info &directory, const xtd::diagnostics::stack_frame &stack_frame=xtd::diagnostics::stack_frame::current())
Asserts that directory not exists.
#define tunit_export_
Define shared library export.
Definition tunit_export.h:13
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.h:10
Contains xtd::tunit::assert class.