#!/usr/bin/perl
Log::Log4perl->easy_init(
$WARN
);
my
%hash
= (
label
=>
"FAIR Property of some sort"
,
minCount
=> 1,
maxCount
=> 1,
);
ok (
my
$P
= FAIR::Profile::Property->new(
%hash
),
"Success in creating FAIR Property"
);
foreach
my
$key
(
keys
%hash
){
ok (
$P
->
$key
eq
$hash
{
$key
},
"value of $key captured correctly"
);
}
delete
$hash
{
'URI'
};
ok ((
$P
= FAIR::Profile::Property->new(
%hash
)),
"FAIR Property created without an explicit URI"
);
ok (
$P
->URI,
"Resulting Property has a URI"
);
ok (
$P
->URI =~ /profileschemaproperty\/\S+/,
"Resulting Property has a URI that isn't empty"
);
ok (
$P
->type ~~ /FAIRProperty/,
"Property is a FAIR Property"
);
ok (
$P
->add_AllowedValue(
$value
),
"Called add_AllowedValue"
);
ok (
ref
(
$P
->allowedValues) eq
"ARRAY"
,
"allowedValues returns arrayref"
);
my
$values
=
$P
->allowedValues();
ok (
$values
->[0] eq
$value
,
"allowedValues captured the allowed value $value"
);