Peace/t/00001-customer-model.t

36 lines
784 B
Perl
Raw Normal View History

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
my $secret_bcrypt = 'hola';
2022-03-14 19:14:05 +01:00
## WHEN
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.';
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
my $secret_bcrypt = 'hola';
2022-03-14 19:14:05 +01:00
my $uuid = 'example';
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.';
}