Peace/t/00001-customer-model.t

36 lines
784 B
Perl

use v5.30.0;
use strict;
use warnings;
use Test::Most tests => 5;
BEGIN {
use_ok 'Peace::Model::Customer';
}
{
## GIVEN
my $secret_bcrypt = 'hola';
## WHEN
my $customer = Peace::Model::Customer->new( secret_bcrypt => $secret_bcrypt );
## 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';
is $customer->uuid, undef, 'Uuid is undef.';
}
{
## GIVEN
my $secret_bcrypt = 'hola';
my $uuid = 'example';
my $customer = Peace::Model::Customer->new( secret_bcrypt => $secret_bcrypt );
## WHEN
$customer->uuid($uuid);
## THEN
is $customer->uuid, $uuid, 'Uuid can be set.';
}