BEGIN { $| = 1;
print
"1..19\n"
; }
END {
print
"not ok 1\n"
unless
$loaded
;}
$loaded
= 1;
$i
= 1;
result(
$i
);
my
$unit
;
{
local
$SIG
{__WARN__} =
sub
{
'IGNORE'
};
$unit
= Bio::MAGE::Measurement::Unit->new();
}
result(
$unit
->isa(
'Bio::MAGE::Measurement::Unit'
));
result(
$unit
->
package
() eq
q[Measurement]
);
result(
$unit
->class_name() eq
q[Bio::MAGE::Measurement::Unit]
);
{
local
$SIG
{__WARN__} =
sub
{
'IGNORE'
};
$unit
= Bio::MAGE::Measurement::Unit->new(
unitName
=> 1);
}
result (
$unit
->getUnitName() == 1);
$unit
->setUnitName(1);
result (
$unit
->getUnitName() == 1);
my
%assns
= Bio::MAGE::Measurement::Unit->associations();
my
$assn
;
{
local
$SIG
{__WARN__} =
sub
{
'IGNORE'
};
$unit
= Bio::MAGE::Measurement::Unit->new(
propertySets
=> [Bio::MAGE::NameValueType->new()]);
}
my
$propertysets_assn
;
{
local
$SIG
{__WARN__} =
sub
{
'IGNORE'
};
$propertysets_assn
= Bio::MAGE::NameValueType->new();
}
result (UNIVERSAL::isa(
$unit
->getPropertySets->[0],
q[Bio::MAGE::NameValueType]
));
result (
$unit
->setPropertySets([
$propertysets_assn
]));
result (UNIVERSAL::isa(
$unit
->getPropertySets,
'ARRAY'
)
and
scalar
@{
$unit
->getPropertySets()} == 1
and
$unit
->getPropertySets->[0] ==
$propertysets_assn
);
$unit
->addPropertySets(
$propertysets_assn
);
result (UNIVERSAL::isa(
$unit
->getPropertySets,
'ARRAY'
)
and
scalar
@{
$unit
->getPropertySets()} == 2
and
$unit
->getPropertySets->[0] ==
$propertysets_assn
and
$unit
->getPropertySets->[1] ==
$propertysets_assn
);
(
$assn
) =
$assns
{propertySets};
result(is_object(
$assn
)
and
$assn
->isa(
'Bio::MAGE::Association'
)
and
defined
$assn
->description(),
and
defined
$assn
->cardinality(),
and
grep
{
$_
eq
$assn
->cardinality} (
'0..1'
,
'1'
,
'1..N'
,
'0..N'
),
and
defined
$assn
->is_ref(),
and (
$assn
->is_ref() == 0 or
$assn
->is_ref() == 1),
and
defined
$assn
->rank(),
and
$assn
->rank(),
and
defined
$assn
->ordered(),
and (
$assn
->ordered() == 0 or
$assn
->ordered() == 1),
and
defined
$assn
->class_name(),
and
$assn
->class_name(),
and
defined
$assn
->name(),
and
$assn
->name(),
);
{
local
$SIG
{__WARN__} =
sub
{
'IGNORE'
};
my
$temperatureunit
= Bio::MAGE::Measurement::TemperatureUnit->new();
result (
$temperatureunit
->isa(
q[Bio::MAGE::Measurement::TemperatureUnit]
));
my
$distanceunit
= Bio::MAGE::Measurement::DistanceUnit->new();
result (
$distanceunit
->isa(
q[Bio::MAGE::Measurement::DistanceUnit]
));
my
$quantityunit
= Bio::MAGE::Measurement::QuantityUnit->new();
result (
$quantityunit
->isa(
q[Bio::MAGE::Measurement::QuantityUnit]
));
my
$massunit
= Bio::MAGE::Measurement::MassUnit->new();
result (
$massunit
->isa(
q[Bio::MAGE::Measurement::MassUnit]
));
my
$concentrationunit
= Bio::MAGE::Measurement::ConcentrationUnit->new();
result (
$concentrationunit
->isa(
q[Bio::MAGE::Measurement::ConcentrationUnit]
));
my
$timeunit
= Bio::MAGE::Measurement::TimeUnit->new();
result (
$timeunit
->isa(
q[Bio::MAGE::Measurement::TimeUnit]
));
my
$volumeunit
= Bio::MAGE::Measurement::VolumeUnit->new();
result (
$volumeunit
->isa(
q[Bio::MAGE::Measurement::VolumeUnit]
));
}
result (
$unit
->isa(
q[Bio::MAGE::Extendable]
));