#include <gtest/gtest.h>
#include "Property_Test_Types.hpp"
TEST(validated_value_test, accepts_range_boundaries) {
    Range_Value<int, 0, 10> minimum{0};
    Range_Value<int, 0, 10> maximum{10};
    EXPECT_EQ(minimum.get(), 0);
    EXPECT_EQ(maximum.get(), 10);
}
TEST(validated_value_test, rejects_values_outside_range) {
    EXPECT_THROW((Range_Value<int, 0, 10>{-1}), std::out_of_range);
    EXPECT_THROW((Range_Value<int, 0, 10>{11}), std::out_of_range);
}
TEST(validated_value_test, keeps_old_value_when_validation_fails) {
    Range_Value<int, 0, 10> value{5};
    EXPECT_THROW(value = 20, std::out_of_range);
    EXPECT_EQ(value.get(), 5);
}
TEST(validated_value_test, supports_custom_validator) {
    Validated_Value<int, Property_Checked_Value_Validator> value{4};
    EXPECT_NO_THROW(value = 6);
    EXPECT_THROW(value = 7, std::invalid_argument);
    EXPECT_EQ(value.get(), 6);
}
