use objc2_foundation::{NSDictionary, NSObject, NSString};
use crate::utils::property_utils::{PropertyAccessor, PropertyUtils};
use crate::utils::test_utils::create_test_dictionary;
struct MockPropertyUtils;
impl PropertyUtils for MockPropertyUtils {
}
#[test]
fn test_property_utils_trait() {
let dict = create_test_dictionary();
let string_result = MockPropertyUtils::get_string_property(&dict, "test_key");
let number_result = MockPropertyUtils::get_number_property(&dict, "test_key");
let bool_result = MockPropertyUtils::get_bool_property(&dict, "test_key");
assert_eq!(string_result, None);
assert_eq!(number_result, None);
assert_eq!(bool_result, None);
}
#[test]
fn test_property_accessor_implements_trait() {
let _: fn(&NSDictionary<NSString, NSObject>, &str) -> Option<String> =
PropertyAccessor::get_string_property;
let _: fn(&NSDictionary<NSString, NSObject>, &str) -> Option<f64> =
PropertyAccessor::get_number_property;
let _: fn(&NSDictionary<NSString, NSObject>, &str) -> Option<bool> =
PropertyAccessor::get_bool_property;
}