|
| 1 | +#include "catch.hpp" |
| 2 | +#include <mfast.h> |
| 3 | + |
| 4 | +#include "fast_test_coding_case_v2.hpp" |
| 5 | +#include "byte_stream.h" |
| 6 | + |
| 7 | +#include "simple19.h" |
| 8 | + |
| 9 | +using namespace test::coding; |
| 10 | + |
| 11 | +TEST_CASE("set data type basic test with default value") |
| 12 | +{ |
| 13 | + fast_test_coding_case_v2<simple19::templates_description> test_case; |
| 14 | + simple19::Test_1 test_1; |
| 15 | + |
| 16 | + { |
| 17 | + simple19::Test_1_mref test_1_mref = test_1.mref(); |
| 18 | + auto TradeCondition = test_1_mref.set_TradeCondition(); |
| 19 | + TradeCondition.set_OpeningPrice(); |
| 20 | + TradeCondition.set_OfficialClosingPrice(); |
| 21 | + } |
| 22 | + |
| 23 | + { |
| 24 | + simple19::Test_1_cref test_1_cref = test_1.cref(); |
| 25 | + auto TradeCondition = test_1_cref.get_TradeCondition(); |
| 26 | + |
| 27 | + REQUIRE(TradeCondition.value() == (0x00 | simple19::TradeConditionSet::ExchangeLast | simple19::TradeConditionSet::OpeningPrice | simple19::TradeConditionSet::OfficialClosingPrice)); |
| 28 | + |
| 29 | + REQUIRE(TradeCondition.has_ExchangeLast()); |
| 30 | + REQUIRE(TradeCondition.has_OpeningPrice()); |
| 31 | + REQUIRE(TradeCondition.has_OfficialClosingPrice()); |
| 32 | + REQUIRE(!TradeCondition.has_Retail()); |
| 33 | + } |
| 34 | +} |
| 35 | + |
| 36 | +TEST_CASE("set data type basic test") |
| 37 | +{ |
| 38 | + fast_test_coding_case_v2<simple19::templates_description> test_case; |
| 39 | + simple19::Test_3 test_3; |
| 40 | + |
| 41 | + { |
| 42 | + simple19::Test_3_mref test_3_mref = test_3.mref(); |
| 43 | + auto TradeCondition = test_3_mref.set_TradeCondition(); |
| 44 | + TradeCondition.set_OpeningPrice(); |
| 45 | + TradeCondition.set_OfficialClosingPrice(); |
| 46 | + } |
| 47 | + |
| 48 | + { |
| 49 | + simple19::Test_3_cref test_3_cref = test_3.cref(); |
| 50 | + auto TradeCondition = test_3_cref.get_TradeCondition(); |
| 51 | + |
| 52 | + REQUIRE(TradeCondition.value() == (0x00 | simple19::TradeConditionSet::OpeningPrice | simple19::TradeConditionSet::OfficialClosingPrice)); |
| 53 | + |
| 54 | + REQUIRE(!TradeCondition.has_ExchangeLast()); |
| 55 | + REQUIRE(TradeCondition.has_OpeningPrice()); |
| 56 | + REQUIRE(TradeCondition.has_OfficialClosingPrice()); |
| 57 | + REQUIRE(!TradeCondition.has_Retail()); |
| 58 | + } |
| 59 | +} |
0 commit comments