Closed jasonriley closed 3 years ago
Please clarify the below points:
createTaxRate method return type is TariffRate (as it's returning TariffRate object). Four mandatory fields are missing in our case for which Typescript is giving error. Those fields are :tariffRateId: number; tariffId: number; riderId: number; tariffSequenceNumber: number;
. What values will these fields hold?
test for error when not passing in a rateAmount
createTaxRate method can't be called without rateAmount having Number value. Typescript will not allow that. Hence this case will not be able to be tested.
Assert that the tariffId field is null.
Isn't tariffId field is mandatory in TariffRate?
This issue is to create a new class that implements the factory pattern for creating new
TariffRate
objects in common, useful ways.Create a new class,
TariffRateFactory
in a new foldersrc/util
. Create a test class for it too.First factory method is
createTaxRate
which takes as inputs ...This returns an object that implements the existing
TariffRate
with the following fields set :Also add 1
TariffRateBand
object on therateBands
property with the following set on itrateAmount
, test for true and false forisFixedAmount
and whether therateName
defaults or not. Asset that all the fields expected to be set are set correctly. Assert that the tariffId field is null.