2022-03-14 19:14:05 +01:00
|
|
|
use v5.30.0;
|
|
|
|
|
|
|
|
use strict;
|
|
|
|
use warnings;
|
|
|
|
|
|
|
|
use Test::Most tests => 5;
|
|
|
|
|
|
|
|
BEGIN {
|
|
|
|
use_ok 'Peace::Model::Customer';
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
## GIVEN
|
2022-03-15 02:45:16 +01:00
|
|
|
my $secret_bcrypt = 'hola';
|
2022-03-14 19:14:05 +01:00
|
|
|
## WHEN
|
2022-03-15 02:45:16 +01:00
|
|
|
my $customer = Peace::Model::Customer->new( secret_bcrypt => $secret_bcrypt );
|
2022-03-14 19:14:05 +01:00
|
|
|
## THEN
|
|
|
|
ok $customer->isa('Peace::Model::Customer'),
|
|
|
|
'Instanced customer is made of Peace::Model::Customer.';
|
2022-03-15 02:45:16 +01:00
|
|
|
is $customer->secret_bcrypt, $secret_bcrypt, 'Secret is correctly setup';
|
2022-03-14 19:14:05 +01:00
|
|
|
is $customer->uuid, undef, 'Uuid is undef.';
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
## GIVEN
|
2022-03-15 02:45:16 +01:00
|
|
|
my $secret_bcrypt = 'hola';
|
2022-03-14 19:14:05 +01:00
|
|
|
my $uuid = 'example';
|
2022-03-15 02:45:16 +01:00
|
|
|
my $customer = Peace::Model::Customer->new( secret_bcrypt => $secret_bcrypt );
|
2022-03-14 19:14:05 +01:00
|
|
|
|
|
|
|
## WHEN
|
|
|
|
$customer->uuid($uuid);
|
|
|
|
|
|
|
|
## THEN
|
|
|
|
is $customer->uuid, $uuid, 'Uuid can be set.';
|
|
|
|
}
|