61 lines
1.5 KiB
Perl
61 lines
1.5 KiB
Perl
|
use v5.30.0;
|
||
|
|
||
|
use strict;
|
||
|
use warnings;
|
||
|
|
||
|
use Test::Most tests => 5;
|
||
|
|
||
|
BEGIN {
|
||
|
use_ok 'Peace::Model::Developer';
|
||
|
}
|
||
|
|
||
|
{
|
||
|
## GIVEN
|
||
|
my $secret_bcrypt = 'hola';
|
||
|
my $name = 'Larry';
|
||
|
my $surname = 'Wall';
|
||
|
my $email = 'larry@perl.org';
|
||
|
my $country = 'US';
|
||
|
my $verified = 0;
|
||
|
## WHEN
|
||
|
my $developer = Peace::Model::Developer->new(
|
||
|
secret_bcrypt => $secret_bcrypt,
|
||
|
name => $name,
|
||
|
surname => $surname,
|
||
|
email => $email,
|
||
|
country => $country,
|
||
|
verified => $verified,
|
||
|
);
|
||
|
## THEN
|
||
|
ok $developer->isa('Peace::Model::Developer'),
|
||
|
'Instanced developer is made of Peace::Model::Developer.';
|
||
|
is $developer->secret_bcrypt, $secret_bcrypt, 'Secret is correctly setup';
|
||
|
is $developer->uuid, undef, 'Uuid is undef.';
|
||
|
}
|
||
|
|
||
|
{
|
||
|
## GIVEN
|
||
|
my $uuid = 'example';
|
||
|
my $secret_bcrypt = 'hola';
|
||
|
my $name = 'Larry';
|
||
|
my $surname = 'Wall';
|
||
|
my $email = 'larry@perl.org';
|
||
|
my $country = 'US';
|
||
|
my $verified = 0;
|
||
|
|
||
|
my $developer = Peace::Model::Developer->new(
|
||
|
secret_bcrypt => $secret_bcrypt,
|
||
|
name => $name,
|
||
|
surname => $surname,
|
||
|
email => $email,
|
||
|
country => $country,
|
||
|
verified => $verified
|
||
|
);
|
||
|
|
||
|
## WHEN
|
||
|
$developer->uuid($uuid);
|
||
|
|
||
|
## THEN
|
||
|
is $developer->uuid, $uuid, 'Uuid can be set.';
|
||
|
}
|