diff --git a/accountCreditedDrawdown_test.go b/accountCreditedDrawdown_test.go index 40d45f13..29cb4a15 100644 --- a/accountCreditedDrawdown_test.go +++ b/accountCreditedDrawdown_test.go @@ -47,7 +47,7 @@ func TestParseAccountCreditedDrawdownWrongLength(t *testing.T) { err := r.parseAccountCreditedDrawdown() - expected := r.parseError(fieldError("DrawdownCreditAccountNumber", ErrValidLengthSize)).Error() + expected := r.parseError(fieldError("DrawdownCreditAccountNumber", ErrValidLength)).Error() require.EqualError(t, err, expected) } diff --git a/accountDebitedDrawdown_test.go b/accountDebitedDrawdown_test.go index 0d8e8e66..5275e20a 100644 --- a/accountDebitedDrawdown_test.go +++ b/accountDebitedDrawdown_test.go @@ -134,7 +134,7 @@ func TestParseAccountDebitedDrawdownWrongLength(t *testing.T) { err := r.parseAccountDebitedDrawdown() - require.EqualError(t, err, r.parseError(fieldError("AddressLineThree", ErrValidLengthSize)).Error()) + require.EqualError(t, err, r.parseError(fieldError("AddressLineThree", ErrValidLength)).Error()) } // TestParseAccountDebitedDrawdownReaderParseError parses a wrong AccountDebitedDrawdown reader parse error diff --git a/actualAmountPaid_test.go b/actualAmountPaid_test.go index 080e96a4..8b55c34e 100644 --- a/actualAmountPaid_test.go +++ b/actualAmountPaid_test.go @@ -70,7 +70,7 @@ func TestParseActualAmountPaidWrongLength(t *testing.T) { err := r.parseActualAmountPaid() - require.EqualError(t, err, r.parseError(fieldError("Amount", ErrValidLengthSize)).Error()) + require.EqualError(t, err, r.parseError(fieldError("Amount", ErrValidLength)).Error()) } // TestParseActualAmountPaidReaderParseError parses a wrong ActualAmountPaid reader parse error diff --git a/adjustment_test.go b/adjustment_test.go index c95d2898..75397805 100644 --- a/adjustment_test.go +++ b/adjustment_test.go @@ -113,7 +113,7 @@ func TestParseAdjustmentWrongLength(t *testing.T) { err := r.parseAdjustment() - require.EqualError(t, err, r.parseError(fieldError("AdditionalInfo", ErrValidLengthSize)).Error()) + require.EqualError(t, err, r.parseError(fieldError("AdditionalInfo", ErrValidLength)).Error()) } // TestParseAdjustmentReaderParseError parses a wrong Adjustment reader parse error diff --git a/amountNegotiatedDiscount_test.go b/amountNegotiatedDiscount_test.go index 222f52eb..47d643fd 100644 --- a/amountNegotiatedDiscount_test.go +++ b/amountNegotiatedDiscount_test.go @@ -70,7 +70,7 @@ func TestParseAmountNegotiatedDiscountWrongLength(t *testing.T) { err := r.parseAmountNegotiatedDiscount() - require.EqualError(t, err, r.parseError(fieldError("Amount", ErrValidLengthSize)).Error()) + require.EqualError(t, err, r.parseError(fieldError("Amount", ErrValidLength)).Error()) } // TestParseAmountNegotiatedDiscountReaderParseError parses a wrong AmountNegotiatedDiscount reader parse error diff --git a/beneficiaryCustomer_test.go b/beneficiaryCustomer_test.go index b12a6ee0..122fd2f4 100644 --- a/beneficiaryCustomer_test.go +++ b/beneficiaryCustomer_test.go @@ -104,7 +104,7 @@ func TestParseBeneficiaryCustomerWrongLength(t *testing.T) { err := r.parseBeneficiaryCustomer() - require.EqualError(t, err, r.parseError(fieldError("SwiftLineFive", ErrValidLengthSize)).Error()) + require.EqualError(t, err, r.parseError(fieldError("SwiftLineFive", ErrValidLength)).Error()) } // TestParseBeneficiaryCustomerReaderParseError parses a wrong BeneficiaryCustomer reader parse error diff --git a/beneficiaryFI_test.go b/beneficiaryFI_test.go index 014765ac..132d036d 100644 --- a/beneficiaryFI_test.go +++ b/beneficiaryFI_test.go @@ -124,7 +124,7 @@ func TestParseBeneficiaryFIWrongLength(t *testing.T) { err := r.parseBeneficiaryFI() - require.EqualError(t, err, r.parseError(fieldError("AddressLineThree", ErrValidLengthSize)).Error()) + require.EqualError(t, err, r.parseError(fieldError("AddressLineThree", ErrValidLength)).Error()) } // TestParseBeneficiaryFIReaderParseError parses a wrong BeneficiaryFI reader parse error diff --git a/beneficiaryIntermediaryFI_test.go b/beneficiaryIntermediaryFI_test.go index d08de6ab..94171db5 100644 --- a/beneficiaryIntermediaryFI_test.go +++ b/beneficiaryIntermediaryFI_test.go @@ -124,7 +124,7 @@ func TestParseBeneficiaryIntermediaryFIWrongLength(t *testing.T) { err := r.parseBeneficiaryIntermediaryFI() - require.EqualError(t, err, r.parseError(fieldError("AddressLineThree", ErrValidLengthSize)).Error()) + require.EqualError(t, err, r.parseError(fieldError("AddressLineThree", ErrValidLength)).Error()) } // TestParseBeneficiaryIntermediaryFIReaderParseError parses a wrong BeneficiaryIntermediaryFI reader parse error diff --git a/beneficiaryReference_test.go b/beneficiaryReference_test.go index 2a971dc3..f3f293c3 100644 --- a/beneficiaryReference_test.go +++ b/beneficiaryReference_test.go @@ -39,7 +39,7 @@ func TestParseBeneficiaryReferenceWrongLength(t *testing.T) { err := r.parseBeneficiaryReference() - require.EqualError(t, err, r.parseError(fieldError("BeneficiaryReference", ErrValidLengthSize)).Error()) + require.EqualError(t, err, r.parseError(fieldError("BeneficiaryReference", ErrValidLength)).Error()) } // TestParseBeneficiaryReferenceReaderParseError parses a wrong BeneficiaryReference reader parse error diff --git a/beneficiary_test.go b/beneficiary_test.go index 1a8a1f20..a43153fd 100644 --- a/beneficiary_test.go +++ b/beneficiary_test.go @@ -114,7 +114,7 @@ func TestParseBeneficiaryWrongLength(t *testing.T) { err := r.parseBeneficiary() - require.EqualError(t, err, r.parseError(fieldError("AddressLineThree", ErrValidLengthSize)).Error()) + require.EqualError(t, err, r.parseError(fieldError("AddressLineThree", ErrValidLength)).Error()) } // TestParseBeneficiaryReaderParseError parses a wrong Beneficiary reader parse error diff --git a/converters.go b/converters.go index 698cfb55..2814a5c9 100644 --- a/converters.go +++ b/converters.go @@ -96,7 +96,7 @@ func (c *converters) parseVariableStringField(r string, maxLen int) (got string, if size > len(r) { size = 0 - err = ErrValidLengthSize + err = ErrValidLength return } diff --git a/currencyInstructedAmount.go b/currencyInstructedAmount.go index e78de8f1..b7afa453 100644 --- a/currencyInstructedAmount.go +++ b/currencyInstructedAmount.go @@ -54,7 +54,7 @@ func (cia *CurrencyInstructedAmount) Parse(record string) error { length += read if len(record) < length+18 { - return fieldError("Amount", ErrValidLengthSize) + return fieldError("Amount", ErrValidLength) } cia.Amount = cia.parseStringField(record[length : length+18]) diff --git a/currencyInstructedAmount_test.go b/currencyInstructedAmount_test.go index 9b60377b..e7a398a2 100644 --- a/currencyInstructedAmount_test.go +++ b/currencyInstructedAmount_test.go @@ -50,11 +50,11 @@ func TestParseCurrencyInstructedAmountWrongLength(t *testing.T) { err := r.parseCurrencyInstructedAmount() - require.EqualError(t, err, r.parseError(fieldError("Amount", ErrValidLengthSize)).Error()) + require.EqualError(t, err, r.parseError(fieldError("Amount", ErrValidLength)).Error()) _, err = r.Read() - require.EqualError(t, err, r.parseError(fieldError("Amount", ErrValidLengthSize)).Error()) + require.EqualError(t, err, r.parseError(fieldError("Amount", ErrValidLength)).Error()) } // TestParseCurrencyInstructedAmountReaderParseError parses a wrong CurrencyInstructedAmount reader parse error diff --git a/exchangeRate_test.go b/exchangeRate_test.go index d0d9fcd8..51ed88ec 100644 --- a/exchangeRate_test.go +++ b/exchangeRate_test.go @@ -39,11 +39,11 @@ func TestParseExchangeRateWrongLength(t *testing.T) { err := r.parseExchangeRate() - require.EqualError(t, err, r.parseError(fieldError("ExchangeRate", ErrValidLengthSize)).Error()) + require.EqualError(t, err, r.parseError(fieldError("ExchangeRate", ErrValidLength)).Error()) _, err = r.Read() - require.EqualError(t, err, r.parseError(fieldError("ExchangeRate", ErrValidLengthSize)).Error()) + require.EqualError(t, err, r.parseError(fieldError("ExchangeRate", ErrValidLength)).Error()) } // TestParseExchangeRateReaderParseError parses a wrong ExchangeRate reader parse error diff --git a/fIBeneficiaryFIAdvice_test.go b/fIBeneficiaryFIAdvice_test.go index 3a60fe92..ad068f86 100644 --- a/fIBeneficiaryFIAdvice_test.go +++ b/fIBeneficiaryFIAdvice_test.go @@ -105,7 +105,7 @@ func TestParseFIBeneficiaryFIAdviceWrongLength(t *testing.T) { err := r.parseFIBeneficiaryFIAdvice() - require.EqualError(t, err, r.parseError(fieldError("LineSix", ErrValidLengthSize)).Error()) + require.EqualError(t, err, r.parseError(fieldError("LineSix", ErrValidLength)).Error()) } // TestParseFIBeneficiaryFIAdviceReaderParseError parses a wrong FIBeneficiaryFIAdvice reader parse error diff --git a/fiAdditionalFIToFI_test.go b/fiAdditionalFIToFI_test.go index 347bc3ce..cf7b07dc 100644 --- a/fiAdditionalFIToFI_test.go +++ b/fiAdditionalFIToFI_test.go @@ -93,7 +93,7 @@ func TestParseFIAdditionalFIToFIWrongLength(t *testing.T) { r.line = line err := r.parseFIAdditionalFIToFI() - require.EqualError(t, err, r.parseError(fieldError("LineSix", ErrValidLengthSize)).Error()) + require.EqualError(t, err, r.parseError(fieldError("LineSix", ErrValidLength)).Error()) } // TestParseFIAdditionalFIToFIReaderParseError parses a wrong FIAdditionalFIToFI reader parse error diff --git a/fiBeneficiaryAdvice_test.go b/fiBeneficiaryAdvice_test.go index f08d1581..e5eb8301 100644 --- a/fiBeneficiaryAdvice_test.go +++ b/fiBeneficiaryAdvice_test.go @@ -98,7 +98,7 @@ func TestParseFIBeneficiaryAdviceWrongLength(t *testing.T) { err := r.parseFIBeneficiaryAdvice() - require.EqualError(t, err, r.parseError(fieldError("LineSix", ErrValidLengthSize)).Error()) + require.EqualError(t, err, r.parseError(fieldError("LineSix", ErrValidLength)).Error()) } // TestParseFIBeneficiaryAdviceReaderParseError parses a wrong FIBeneficiaryAdvice reader parse error diff --git a/fiBeneficiaryFI_test.go b/fiBeneficiaryFI_test.go index 8e357ea7..8693164e 100644 --- a/fiBeneficiaryFI_test.go +++ b/fiBeneficiaryFI_test.go @@ -94,7 +94,7 @@ func TestParseFIBeneficiaryFIWrongLength(t *testing.T) { err := r.parseFIBeneficiaryFI() - require.EqualError(t, err, r.parseError(fieldError("LineSix", ErrValidLengthSize)).Error()) + require.EqualError(t, err, r.parseError(fieldError("LineSix", ErrValidLength)).Error()) } // TestParseFIBeneficiaryFIReaderParseError parses a wrong FIBeneficiaryFI reader parse error diff --git a/fiBeneficiary_test.go b/fiBeneficiary_test.go index 78244f43..4ddea90a 100644 --- a/fiBeneficiary_test.go +++ b/fiBeneficiary_test.go @@ -93,7 +93,7 @@ func TestParseFIBeneficiaryWrongLength(t *testing.T) { r.line = line err := r.parseFIBeneficiary() - require.EqualError(t, err, r.parseError(fieldError("LineSix", ErrValidLengthSize)).Error()) + require.EqualError(t, err, r.parseError(fieldError("LineSix", ErrValidLength)).Error()) } // TestParseFIBeneficiaryReaderParseError parses a wrong FIBeneficiary reader parse error diff --git a/fiDrawdownDebitAccountAdvice_test.go b/fiDrawdownDebitAccountAdvice_test.go index d05ada0c..c2573d9d 100644 --- a/fiDrawdownDebitAccountAdvice_test.go +++ b/fiDrawdownDebitAccountAdvice_test.go @@ -105,7 +105,7 @@ func TestParseFIDrawdownDebitAccountAdviceWrongLength(t *testing.T) { err := r.parseFIDrawdownDebitAccountAdvice() - require.EqualError(t, err, r.parseError(fieldError("LineSix", ErrValidLengthSize)).Error()) + require.EqualError(t, err, r.parseError(fieldError("LineSix", ErrValidLength)).Error()) } // TestParseFIDrawdownDebitAccountAdviceReaderParseError parses a wrong FIDrawdownDebitAccountAdvice reader parse error diff --git a/fiIntermediaryFIAdvice_test.go b/fiIntermediaryFIAdvice_test.go index 99198414..ca1770c9 100644 --- a/fiIntermediaryFIAdvice_test.go +++ b/fiIntermediaryFIAdvice_test.go @@ -104,7 +104,7 @@ func TestParseFIIntermediaryFIAdviceWrongLength(t *testing.T) { r.line = line err := r.parseFIIntermediaryFIAdvice() - require.EqualError(t, err, r.parseError(fieldError("LineSix", ErrValidLengthSize)).Error()) + require.EqualError(t, err, r.parseError(fieldError("LineSix", ErrValidLength)).Error()) } // TestParseFIIntermediaryFIAdviceReaderParseError parses a wrong FIIntermediaryFIAdvice reader parse error diff --git a/fiIntermediaryFI_test.go b/fiIntermediaryFI_test.go index 80be2905..294f89dc 100644 --- a/fiIntermediaryFI_test.go +++ b/fiIntermediaryFI_test.go @@ -93,7 +93,7 @@ func TestParseFIIntermediaryFIWrongLength(t *testing.T) { r.line = line err := r.parseFIIntermediaryFI() - require.EqualError(t, err, r.parseError(fieldError("LineSix", ErrValidLengthSize)).Error()) + require.EqualError(t, err, r.parseError(fieldError("LineSix", ErrValidLength)).Error()) } // TestParseFIIntermediaryFIReaderParseError parses a wrong FIIntermediaryFI reader parse error diff --git a/fiPaymentMethodToBeneficiary_test.go b/fiPaymentMethodToBeneficiary_test.go index 57f81dbf..86204acb 100644 --- a/fiPaymentMethodToBeneficiary_test.go +++ b/fiPaymentMethodToBeneficiary_test.go @@ -49,7 +49,7 @@ func TestParseFIPaymentMethodToBeneficiaryWrongLength(t *testing.T) { r.line = line err := r.parseFIPaymentMethodToBeneficiary() - require.EqualError(t, err, r.parseError(fieldError("AdditionalInformation", ErrValidLengthSize)).Error()) + require.EqualError(t, err, r.parseError(fieldError("AdditionalInformation", ErrValidLength)).Error()) } // TestParseFIPaymentMethodToBeneficiaryReaderParseError parses a wrong FIPaymentMethodToBeneficiary reader parse error diff --git a/fiReceiverFI_test.go b/fiReceiverFI_test.go index 6320d5e4..2dba54d2 100644 --- a/fiReceiverFI_test.go +++ b/fiReceiverFI_test.go @@ -93,7 +93,7 @@ func TestParseFIReceiverFIWrongLength(t *testing.T) { r.line = line err := r.parseFIReceiverFI() - require.EqualError(t, err, r.parseError(fieldError("LineSix", ErrValidLengthSize)).Error()) + require.EqualError(t, err, r.parseError(fieldError("LineSix", ErrValidLength)).Error()) } // TestParseFIReceiverFIReaderParseError parses a wrong FIReceiverFI reader parse error diff --git a/fieldErrors.go b/fieldErrors.go index b83b0bad..b7801a0d 100644 --- a/fieldErrors.go +++ b/fieldErrors.go @@ -123,8 +123,8 @@ var ( // ErrOptionFName is returned for an invalid name for OriginatorOptionF ErrOptionFName = errors.New("is an invalid name for originator optionF") - // ErrValidLengthSize is returned for an field with invalid length - ErrValidLengthSize = errors.New("is an invalid length size") + // ErrValidLength is returned for an field with invalid length + ErrValidLength = errors.New("is an invalid length") ) // FieldError is returned for errors at a field level in a tag diff --git a/grossAmountRemittanceDocument_test.go b/grossAmountRemittanceDocument_test.go index e13d6fdb..6920682e 100644 --- a/grossAmountRemittanceDocument_test.go +++ b/grossAmountRemittanceDocument_test.go @@ -62,7 +62,7 @@ func TestParseGrossAmountRemittanceWrongLength(t *testing.T) { err := r.parseGrossAmountRemittanceDocument() - require.EqualError(t, err, r.parseError(fieldError("Amount", ErrValidLengthSize)).Error()) + require.EqualError(t, err, r.parseError(fieldError("Amount", ErrValidLength)).Error()) } // TestParseGrossAmountRemittanceReaderParseError parses a wrong GrossAmountRemittance reader parse error diff --git a/institutionAccount_test.go b/institutionAccount_test.go index d4297296..e92ca568 100644 --- a/institutionAccount_test.go +++ b/institutionAccount_test.go @@ -104,7 +104,7 @@ func TestParseInstitutionAccountWrongLength(t *testing.T) { err := r.parseInstitutionAccount() - require.EqualError(t, err, r.parseError(fieldError("SwiftLineFive", ErrValidLengthSize)).Error()) + require.EqualError(t, err, r.parseError(fieldError("SwiftLineFive", ErrValidLength)).Error()) } // TestParseInstitutionAccountReaderParseError parses a wrong InstitutionAccount reader parse error diff --git a/instructedAmount_test.go b/instructedAmount_test.go index abb0ebfa..99c44ffd 100644 --- a/instructedAmount_test.go +++ b/instructedAmount_test.go @@ -70,7 +70,7 @@ func TestParseInstructedAmountWrongLength(t *testing.T) { err := r.parseInstructedAmount() - require.EqualError(t, err, r.parseError(fieldError("Amount", ErrValidLengthSize)).Error()) + require.EqualError(t, err, r.parseError(fieldError("Amount", ErrValidLength)).Error()) } // TestParseInstructedAmountReaderParseError parses a wrong InstructedAmount reader parse error diff --git a/instructingFI_test.go b/instructingFI_test.go index e43d9bf7..444abb16 100644 --- a/instructingFI_test.go +++ b/instructingFI_test.go @@ -124,7 +124,7 @@ func TestParseInstructingFIWrongLength(t *testing.T) { err := r.parseInstructingFI() - require.EqualError(t, err, r.parseError(fieldError("AddressLineThree", ErrValidLengthSize)).Error()) + require.EqualError(t, err, r.parseError(fieldError("AddressLineThree", ErrValidLength)).Error()) } // TestParseInstructingFIReaderParseError parses a wrong InstructingFI reader parse error diff --git a/intermediaryInstitution_test.go b/intermediaryInstitution_test.go index a12f59d2..ef1aefb0 100644 --- a/intermediaryInstitution_test.go +++ b/intermediaryInstitution_test.go @@ -104,7 +104,7 @@ func TestParseIntermediaryInstitutionWrongLength(t *testing.T) { err := r.parseIntermediaryInstitution() - require.EqualError(t, err, r.parseError(fieldError("SwiftLineFive", ErrValidLengthSize)).Error()) + require.EqualError(t, err, r.parseError(fieldError("SwiftLineFive", ErrValidLength)).Error()) } // TestParseIntermediaryInstitutionReaderParseError parses a wrong IntermediaryInstitution reader parse error diff --git a/localInstrument_test.go b/localInstrument_test.go index 25b77c12..b832cd21 100644 --- a/localInstrument_test.go +++ b/localInstrument_test.go @@ -61,7 +61,7 @@ func TestParseLocalInstrumentWrongLength(t *testing.T) { err := r.parseLocalInstrument() - require.EqualError(t, err, r.parseError(fieldError("ProprietaryCode", ErrValidLengthSize)).Error()) + require.EqualError(t, err, r.parseError(fieldError("ProprietaryCode", ErrValidLength)).Error()) } // TestParseLocalInstrumentReaderParseError parses a wrong LocalInstrumente reader parse error diff --git a/orderingCustomer_test.go b/orderingCustomer_test.go index d2ed534a..18b39919 100644 --- a/orderingCustomer_test.go +++ b/orderingCustomer_test.go @@ -104,7 +104,7 @@ func TestParseOrderingCustomerWrongLength(t *testing.T) { err := r.parseOrderingCustomer() - require.EqualError(t, err, r.parseError(fieldError("SwiftLineFive", ErrValidLengthSize)).Error()) + require.EqualError(t, err, r.parseError(fieldError("SwiftLineFive", ErrValidLength)).Error()) } // TestParseOrderingCustomerReaderParseError parses a wrong OrderingCustomer reader parse error diff --git a/orderingInstitution_test.go b/orderingInstitution_test.go index d3dbb6e2..d2e0ea9c 100644 --- a/orderingInstitution_test.go +++ b/orderingInstitution_test.go @@ -103,7 +103,7 @@ func TestParseOrderingInstitutionWrongLength(t *testing.T) { r.line = line err := r.parseOrderingInstitution() - require.EqualError(t, err, r.parseError(fieldError("SwiftLineFive", ErrValidLengthSize)).Error()) + require.EqualError(t, err, r.parseError(fieldError("SwiftLineFive", ErrValidLength)).Error()) } // TestParseOrderingInstitutionReaderParseError parses a wrong OrderingInstitution reader parse error diff --git a/originatorFI_test.go b/originatorFI_test.go index 21005c81..aca23c2c 100644 --- a/originatorFI_test.go +++ b/originatorFI_test.go @@ -124,7 +124,7 @@ func TestParseOriginatorFIWrongLength(t *testing.T) { err := r.parseOriginatorFI() - require.EqualError(t, err, r.parseError(fieldError("AddressLineThree", ErrValidLengthSize)).Error()) + require.EqualError(t, err, r.parseError(fieldError("AddressLineThree", ErrValidLength)).Error()) } // TestParseOriginatorFIReaderParseError parses a wrong OriginatorFI reader parse error diff --git a/originatorOptionF_test.go b/originatorOptionF_test.go index b8d971be..b939df90 100644 --- a/originatorOptionF_test.go +++ b/originatorOptionF_test.go @@ -156,7 +156,7 @@ func TestParseOriginatorOptionFWrongLength(t *testing.T) { err := r.parseOriginatorOptionF() - require.EqualError(t, err, r.parseError(fieldError("LineThree", ErrValidLengthSize)).Error()) + require.EqualError(t, err, r.parseError(fieldError("LineThree", ErrValidLength)).Error()) } // TestParseOriginatorOptionFReaderParseError parses a wrong OriginatorOptionF reader parse error diff --git a/originatorToBeneficiary_test.go b/originatorToBeneficiary_test.go index f4870949..605514a1 100644 --- a/originatorToBeneficiary_test.go +++ b/originatorToBeneficiary_test.go @@ -72,7 +72,7 @@ func TestParseOriginatorToBeneficiaryWrongLength(t *testing.T) { err := r.parseOriginatorToBeneficiary() - require.EqualError(t, err, r.parseError(fieldError("LineFour", ErrValidLengthSize)).Error()) + require.EqualError(t, err, r.parseError(fieldError("LineFour", ErrValidLength)).Error()) } // TestParseOriginatorToBeneficiaryReaderParseError parses a wrong OriginatorToBeneficiary reader parse error diff --git a/originator_test.go b/originator_test.go index 373956bc..0527e05a 100644 --- a/originator_test.go +++ b/originator_test.go @@ -117,7 +117,7 @@ func TestParseOriginatorWrongLength(t *testing.T) { err := r.parseOriginator() - require.EqualError(t, err, r.parseError(fieldError("AddressLineThree", ErrValidLengthSize)).Error()) + require.EqualError(t, err, r.parseError(fieldError("AddressLineThree", ErrValidLength)).Error()) } // TestParseOriginatorReaderParseError parses a wrong Originator reader parse error diff --git a/outputMessageAccountabilityData.go b/outputMessageAccountabilityData.go index 4a4438e4..e2757115 100644 --- a/outputMessageAccountabilityData.go +++ b/outputMessageAccountabilityData.go @@ -68,7 +68,7 @@ func (omad *OutputMessageAccountabilityData) Parse(record string) error { length += read if len(record) < length+6 { - return fieldError("OutputSequenceNumber", ErrValidLengthSize) + return fieldError("OutputSequenceNumber", ErrValidLength) } omad.OutputSequenceNumber = record[length : length+6] diff --git a/paymentNotification_test.go b/paymentNotification_test.go index d2ddd117..45443c22 100644 --- a/paymentNotification_test.go +++ b/paymentNotification_test.go @@ -105,7 +105,7 @@ func TestParsePaymentNotificationWrongLength(t *testing.T) { err := r.parsePaymentNotification() - require.EqualError(t, err, r.parseError(fieldError("EndToEndIdentification", ErrValidLengthSize)).Error()) + require.EqualError(t, err, r.parseError(fieldError("EndToEndIdentification", ErrValidLength)).Error()) } // TestParsePaymentNotificationReaderParseError parses a wrong PaymentNotification reader parse error diff --git a/previousMessageIdentifier_test.go b/previousMessageIdentifier_test.go index c4039455..907ccf25 100644 --- a/previousMessageIdentifier_test.go +++ b/previousMessageIdentifier_test.go @@ -39,7 +39,7 @@ func TestParsePreviousMessageIdentifierWrongLength(t *testing.T) { err := r.parsePreviousMessageIdentifier() - require.EqualError(t, err, r.parseError(fieldError("PreviousMessageIdentifier", ErrValidLengthSize)).Error()) + require.EqualError(t, err, r.parseError(fieldError("PreviousMessageIdentifier", ErrValidLength)).Error()) } // TestParsePreviousMessageIdentifierReaderParseError parses a wrong PreviousMessageIdentifier reader parse error diff --git a/primaryRemittanceDocument_test.go b/primaryRemittanceDocument_test.go index 683abf80..166f245b 100644 --- a/primaryRemittanceDocument_test.go +++ b/primaryRemittanceDocument_test.go @@ -105,7 +105,7 @@ func TestParsePrimaryRemittanceDocumentWrongLength(t *testing.T) { err := r.parsePrimaryRemittanceDocument() - require.EqualError(t, err, r.parseError(fieldError("Issuer", ErrValidLengthSize)).Error()) + require.EqualError(t, err, r.parseError(fieldError("Issuer", ErrValidLength)).Error()) } // TestParsePrimaryRemittanceDocumentReaderParseError parses a wrong PrimaryRemittanceDocument reader parse error diff --git a/relatedRemittance_test.go b/relatedRemittance_test.go index b8f6b0cc..41db9421 100644 --- a/relatedRemittance_test.go +++ b/relatedRemittance_test.go @@ -259,7 +259,7 @@ func TestParseRelatedRemittanceWrongLength(t *testing.T) { err := r.parseRelatedRemittance() - require.EqualError(t, err, r.parseError(fieldError("AddressLineSeven", ErrValidLengthSize)).Error()) + require.EqualError(t, err, r.parseError(fieldError("AddressLineSeven", ErrValidLength)).Error()) } // TestParseRelatedRemittanceReaderParseError parses a wrong RelatedRemittance reader parse error diff --git a/remittanceBeneficiary_test.go b/remittanceBeneficiary_test.go index 2cbe1fcc..62dc8171 100644 --- a/remittanceBeneficiary_test.go +++ b/remittanceBeneficiary_test.go @@ -348,7 +348,7 @@ func TestParseRemittanceBeneficiaryWrongLength(t *testing.T) { err := r.parseRemittanceBeneficiary() - require.EqualError(t, err, r.parseError(fieldError("AddressLineSeven", ErrValidLengthSize)).Error()) + require.EqualError(t, err, r.parseError(fieldError("AddressLineSeven", ErrValidLength)).Error()) } // TestParseRemittanceBeneficiaryReaderParseError parses a wrong RemittanceBeneficiary reader parse error diff --git a/remittanceFreeText_test.go b/remittanceFreeText_test.go index 69f6d6ee..ba840ac7 100644 --- a/remittanceFreeText_test.go +++ b/remittanceFreeText_test.go @@ -61,7 +61,7 @@ func TestParseRemittanceFreeTextWrongLength(t *testing.T) { err := r.parseRemittanceFreeText() - require.EqualError(t, err, r.parseError(fieldError("LineThree", ErrValidLengthSize)).Error()) + require.EqualError(t, err, r.parseError(fieldError("LineThree", ErrValidLength)).Error()) } // TestParseRemittanceFreeTextReaderParseError parses a wrong RemittanceFreeText reader parse error diff --git a/remittanceOriginator_test.go b/remittanceOriginator_test.go index f9e33beb..4812fafb 100644 --- a/remittanceOriginator_test.go +++ b/remittanceOriginator_test.go @@ -416,7 +416,7 @@ func TestParseRemittanceOriginatorWrongLength(t *testing.T) { err := r.parseRemittanceOriginator() - require.EqualError(t, err, r.parseError(fieldError("ContactOther", ErrValidLengthSize)).Error()) + require.EqualError(t, err, r.parseError(fieldError("ContactOther", ErrValidLength)).Error()) } // TestParseRemittanceOriginatorReaderParseError parses a wrong RemittanceOriginator reader parse error diff --git a/remittance_test.go b/remittance_test.go index 6c088705..f36ce257 100644 --- a/remittance_test.go +++ b/remittance_test.go @@ -103,7 +103,7 @@ func TestParseRemittanceWrongLength(t *testing.T) { err := r.parseRemittance() - require.EqualError(t, err, r.parseError(fieldError("SwiftLineFour", ErrValidLengthSize)).Error()) + require.EqualError(t, err, r.parseError(fieldError("SwiftLineFour", ErrValidLength)).Error()) } // TestParseRemittanceReaderParseError parses a wrong Remittance reader parse error diff --git a/secondaryRemittanceDocument_test.go b/secondaryRemittanceDocument_test.go index f208593e..1d5be7a3 100644 --- a/secondaryRemittanceDocument_test.go +++ b/secondaryRemittanceDocument_test.go @@ -105,7 +105,7 @@ func TestParseSecondaryRemittanceDocumentWrongLength(t *testing.T) { err := r.parseSecondaryRemittanceDocument() - require.EqualError(t, err, r.parseError(fieldError("Issuer", ErrValidLengthSize)).Error()) + require.EqualError(t, err, r.parseError(fieldError("Issuer", ErrValidLength)).Error()) } // TestParseSecondaryRemittanceDocumentReaderParseError parses a wrong SecondaryRemittanceDocument reader parse error diff --git a/senderDepositoryInstitution_test.go b/senderDepositoryInstitution_test.go index 2565dea8..c83547f3 100644 --- a/senderDepositoryInstitution_test.go +++ b/senderDepositoryInstitution_test.go @@ -73,7 +73,7 @@ func TestParseSenderWrongLength(t *testing.T) { err := r.parseSenderDepositoryInstitution() - require.EqualError(t, err, r.parseError(fieldError("SenderABANumber", ErrValidLengthSize)).Error()) + require.EqualError(t, err, r.parseError(fieldError("SenderABANumber", ErrValidLength)).Error()) } // TestParseSenderReaderParseError parses a wrong Sender reader parse error diff --git a/senderReference_test.go b/senderReference_test.go index 1449c4d4..0475133e 100644 --- a/senderReference_test.go +++ b/senderReference_test.go @@ -39,7 +39,7 @@ func TestParseSenderReferenceWrongLength(t *testing.T) { err := r.parseSenderReference() - require.EqualError(t, err, r.parseError(fieldError("SenderReference", ErrValidLengthSize)).Error()) + require.EqualError(t, err, r.parseError(fieldError("SenderReference", ErrValidLength)).Error()) } // TestParseSenderReferenceReaderParseError parses a wrong SenderReference reader parse error diff --git a/senderSupplied.go b/senderSupplied.go index 51d1769e..0ae71551 100644 --- a/senderSupplied.go +++ b/senderSupplied.go @@ -61,7 +61,7 @@ func (ss *SenderSupplied) Parse(record string) error { length += read if len(record) < length+1 { - return fieldError("TestProductionCode", ErrValidLengthSize) + return fieldError("TestProductionCode", ErrValidLength) } ss.TestProductionCode = ss.parseStringField(record[length : length+1]) diff --git a/senderToReceiver_test.go b/senderToReceiver_test.go index a43ddded..f30d2b4d 100644 --- a/senderToReceiver_test.go +++ b/senderToReceiver_test.go @@ -105,7 +105,7 @@ func TestParseSenderToReceiverWrongLength(t *testing.T) { err := r.parseSenderToReceiver() - require.EqualError(t, err, r.parseError(fieldError("SwiftLineSix", ErrValidLengthSize)).Error()) + require.EqualError(t, err, r.parseError(fieldError("SwiftLineSix", ErrValidLength)).Error()) } // TestParseSenderToReceiverReaderParseError parses a wrong SenderToReceiver reader parse error diff --git a/serviceMessage_test.go b/serviceMessage_test.go index 23f07a9b..e66b59f4 100644 --- a/serviceMessage_test.go +++ b/serviceMessage_test.go @@ -170,7 +170,7 @@ func TestParseServiceMessageWrongLength(t *testing.T) { err := r.parseServiceMessage() - require.EqualError(t, err, r.parseError(fieldError("LineTwelve", ErrValidLengthSize)).Error()) + require.EqualError(t, err, r.parseError(fieldError("LineTwelve", ErrValidLength)).Error()) } // TestParseServiceMessageReaderParseError parses a wrong ServiceMessage reader parse error