2018-08-15 14:06:07 -04:00
|
|
|
/**
|
|
|
|
* Tests ClientQuote
|
|
|
|
*
|
2019-08-30 09:41:33 -04:00
|
|
|
* Copyright (C) 2010-2019 R-T Specialty, LLC.
|
2018-08-15 14:06:07 -04:00
|
|
|
*
|
|
|
|
* This file is part of the Liza Data Collection Framework.
|
|
|
|
*
|
|
|
|
* liza is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
'use strict';
|
|
|
|
|
|
|
|
const chai = require( 'chai' );
|
|
|
|
const expect = chai.expect;
|
|
|
|
const { BaseQuote } = require( '../../../' ).quote;
|
|
|
|
const { ClientQuote } = require( '../../../' ).client.quote;
|
|
|
|
const { QuoteDataBucket } = require( '../../../' ).bucket;
|
|
|
|
|
|
|
|
describe( 'ClientQuote', () =>
|
|
|
|
{
|
2018-08-15 15:05:21 -04:00
|
|
|
const base_quote = BaseQuote( 123, QuoteDataBucket() );
|
|
|
|
const start_date = 12345;
|
|
|
|
const agent_id = 90000;
|
|
|
|
const agent_name = 'John Doe';
|
2018-08-16 07:35:52 -04:00
|
|
|
const agent_entity_id = 12434300;
|
2018-08-15 15:05:21 -04:00
|
|
|
const initial_rated_date = 1531507748;
|
2019-06-12 17:51:31 -04:00
|
|
|
const last_rated_date = 1531508748;
|
2018-08-15 15:05:21 -04:00
|
|
|
const quote = ClientQuote(
|
|
|
|
base_quote,
|
2018-08-15 14:06:07 -04:00
|
|
|
{
|
2019-06-12 17:51:31 -04:00
|
|
|
startDate: start_date,
|
|
|
|
agentId: agent_id,
|
|
|
|
agentName: agent_name,
|
|
|
|
agentEntityId: agent_entity_id,
|
2018-08-15 15:05:21 -04:00
|
|
|
initialRatedDate: initial_rated_date,
|
2019-06-12 17:51:31 -04:00
|
|
|
lastRatedDate: last_rated_date,
|
2018-08-15 14:06:07 -04:00
|
|
|
},
|
2019-06-12 17:51:31 -04:00
|
|
|
bucket => bucket
|
2018-08-15 14:06:07 -04:00
|
|
|
);
|
|
|
|
|
2018-08-15 15:05:21 -04:00
|
|
|
it( 'getStartDate returns base quote startDate', () =>
|
2018-08-15 14:06:07 -04:00
|
|
|
{
|
2018-08-15 15:05:21 -04:00
|
|
|
expect( quote.getStartDate() ).to.equal( start_date );
|
2018-08-15 14:06:07 -04:00
|
|
|
} );
|
|
|
|
|
2018-08-15 15:05:21 -04:00
|
|
|
it( 'getAgentId returns base quote agentId', () =>
|
2018-08-15 14:06:07 -04:00
|
|
|
{
|
2018-08-15 15:05:21 -04:00
|
|
|
expect( quote.getAgentId() ).to.equal( agent_id );
|
2018-08-15 14:06:07 -04:00
|
|
|
} );
|
|
|
|
|
2018-08-15 15:05:21 -04:00
|
|
|
it( 'getAgentName returns base quote agentName', () =>
|
2018-08-15 14:06:07 -04:00
|
|
|
{
|
2018-08-15 15:05:21 -04:00
|
|
|
expect( quote.getAgentName() ).to.equal( agent_name );
|
2018-08-15 14:06:07 -04:00
|
|
|
} );
|
|
|
|
|
2018-08-15 15:05:21 -04:00
|
|
|
it( 'getAgentEntityId returns base quote agentEntityId', () =>
|
2018-08-15 14:06:07 -04:00
|
|
|
{
|
2018-08-15 15:05:21 -04:00
|
|
|
expect( quote.getAgentEntityId() ).to.equal( agent_entity_id );
|
2018-08-15 14:06:07 -04:00
|
|
|
} );
|
|
|
|
|
2018-08-15 15:05:21 -04:00
|
|
|
it( 'getInitialRatedDate returns base quote initialRatedDate', () =>
|
2018-08-15 14:06:07 -04:00
|
|
|
{
|
2018-08-15 15:05:21 -04:00
|
|
|
expect( quote.getInitialRatedDate() ).to.equal( initial_rated_date );
|
2018-08-15 14:06:07 -04:00
|
|
|
} );
|
2019-06-12 17:51:31 -04:00
|
|
|
|
|
|
|
it( 'getLastPremiumDate returns base quote lastRatedDate', () =>
|
|
|
|
{
|
|
|
|
expect( quote.getLastPremiumDate() ).to.equal( last_rated_date );
|
|
|
|
} );
|
2018-08-15 14:06:07 -04:00
|
|
|
} );
|