xtd 1.0.0
Loading...
Searching...
No Matches
actual_value.hpp
Go to the documentation of this file.
1
4#pragma once
5#include "assert_type.hpp"
6
8namespace xtd {
10 namespace tunit {
12 namespace constraints {
14 class assert_value;
16
17 template<typename actual_t>
18 class actual_value {
19 protected:
21
23 actual_value() {}
25
27
29 [[nodiscard]] auto assert_type() const noexcept -> xtd::tunit::constraints::assert_type {return assert_type_;};
30 [[nodiscard]] auto type(xtd::tunit::constraints::assert_type assert_type) noexcept -> actual_value& {
31 assert_type_ = assert_type;
32 return self_;
33 };
34
35 [[nodiscard]] auto is_assert() const noexcept {return assert_type() == xtd::tunit::constraints::assert_type::assert;}
36 [[nodiscard]] auto is_valid() const noexcept {return assert_type() == xtd::tunit::constraints::assert_type::valid;}
37 [[nodiscard]] auto is_assume() const noexcept {return assert_type() == xtd::tunit::constraints::assert_type::assume;}
38
39 [[nodiscard]] const actual_t& actual() const noexcept {return *actual_;}
40 [[nodiscard]] actual_value& actual(const actual_t& actual) noexcept {
41 actual_ = &actual;
42 return self_;
43 }
45
46 private:
47 friend class assert_value;
48 xtd::tunit::constraints::assert_type assert_type_;
49 const actual_t* actual_ = null;
50 };
51 }
52 }
53}
Contains xtd::tunit::constraints::assert_type enum.
Definition assert_value.hpp:13
#define self_
The self_ expression is a reference value expression whose value is the reference of the implicit obj...
Definition self.hpp:20
std::type_info type
Stores information about a type.
Definition type.hpp:23
null_ptr null
Represents a null pointer value.
The constraints namespace contains the constraint-based assert model.
Definition actual_value.hpp:12
The tunit namespace contains a unit test library.
Definition abort_error.hpp:10
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8