Bona Iqiniso Application Board

V3BiFreeTextArray

Class Definitions

Class NameV3BiFreeTextArray
Attributesitems: V3BiFreeTextBase[]
Methodsconstructor(language: V3BiFreeTextBase)
getFreeText(reference: string): V3BiFreeTextBase | undefined
getFreeTextbyLanguage(reference: string, language: string): string
addFreeText(reference: string, translations: V3BiTranslationBase[]) : void
Class NameV3BiFreeTextBase
Attributesreference: string
translations: V3BiTranslationBase[]
Class NameV3BiTranslationBase
Attributeslanguage: string
text: string

Constructor Method

Requirement IDDescription
non-empty V3BiFreeText arrayGiven a non-empty V3BiFreeText array as parameter
When the constructor is invoked,
Then the constructor shall initialize the V3BiFreeTextArray.items with the provided, non-empty, array of V3BIFreeTextBase.
empty V3BiFreeText arrayGiven an empty V3BiFreeText array as parameter
When the constructor is invoked,
Then the system shall initialize the V3BiFreeTextArray.items with an empty array.

getFreeText(reference) Method

Requirement IDDescription
existing referenceGiven an existing reference as parameter
When getFreeText is called
Then a V3BiFreeTextBase with the given reference is returned
non-existing referenceGiven a non-existing reference as parameter
When getFreeText is called
Then
‘undefined’ is returned

getFreeTextbyLanguage(reference, language) Method

Requirement IDDescription
non existing referenceGiven a non-existing reference as parameter
When getFreeTextbyLanguage is called
Then
‘unknown free text’ is returned
non-existing languageGiven an existing reference and
a non-existing language as parameter
When getFreeTextbyLanguage is called
Then
‘unknown language’ is returned
existing reference/language Given an existing reference and existing language as parameter
When getFreeTextbyLanguage is called
Then
the translation.text is returned

addFreeText(reference, translations) Method

Requirement IDDescription
existing referenceGiven an existing reference as parameter
When addFreeText is called
Then
error is thrown ‘duplicate free text’
non-existing referenceGiven an non-existing reference as parameter
When addFreeText is called
Then
V3BiFreeTextBase is added to V3BiFreeTextArray.items