Skip to content

Commit

Permalink
mocks
Browse files Browse the repository at this point in the history
mocks for mandatory, beneficiary and originator
  • Loading branch information
bkmoovio committed Apr 10, 2019
1 parent 8ebb708 commit 9210de1
Show file tree
Hide file tree
Showing 37 changed files with 236 additions and 40 deletions.
4 changes: 2 additions & 2 deletions accountCreditedDrawdown.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ type AccountCreditedDrawdown struct {
}

// NewAccountCreditedDrawdown returns a new AccountCreditedDrawdown
func NewAccountCreditedDrawdown() AccountCreditedDrawdown {
creditDD := AccountCreditedDrawdown{
func NewAccountCreditedDrawdown() *AccountCreditedDrawdown {
creditDD := &AccountCreditedDrawdown{
tag: TagAccountCreditedDrawdown,
}
return creditDD
Expand Down
8 changes: 8 additions & 0 deletions accountCreditedDrawdown_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package wire

// mockAccountCreditedDrawdown creates a AccountCreditedDrawdown
func mockAccountCreditedDrawdown() *AccountCreditedDrawdown {
creditDD := NewAccountCreditedDrawdown()
creditDD.DrawdownCreditAccountNumber = "123456789"
return creditDD
}
4 changes: 2 additions & 2 deletions accountDebitedDrawdown.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ type AccountDebitedDrawdown struct {
}

// NewAccountDebitedDrawdown returns a new AccountDebitedDrawdown
func NewAccountDebitedDrawdown() AccountDebitedDrawdown {
debitDD := AccountDebitedDrawdown{
func NewAccountDebitedDrawdown() *AccountDebitedDrawdown {
debitDD := &AccountDebitedDrawdown{
tag: TagAccountDebitedDrawdown,
}
return debitDD
Expand Down
13 changes: 13 additions & 0 deletions accountDebitedDrawdown_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package wire

// mockAccountDebitedDrawdown creates a AccountDebitedDrawdown
func mockAccountDebitedDrawdown() *AccountDebitedDrawdown {
debitDD := NewAccountDebitedDrawdown()
debitDD.IdentificationCode = "DemandDepositAccountNumber"
debitDD.Identifier = "123456789"
debitDD.Name = "debitDD Name"
debitDD.Address.AddressLineOne = "Address One"
debitDD.Address.AddressLineTwo = "Address Two"
debitDD.Address.AddressLineThree = "Address Three"
return debitDD
}
4 changes: 2 additions & 2 deletions amount.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ type Amount struct {
}

// NewAmount returns a new Amount
func NewAmount() Amount {
a := Amount{
func NewAmount() *Amount {
a := &Amount{
tag: TagAmount,
}
return a
Expand Down
8 changes: 8 additions & 0 deletions amount_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package wire

// mockAmount creates an a Amount
func mockAmount() *Amount {
a := NewAmount()
a.Amount = "000001234567"
return a
}
4 changes: 2 additions & 2 deletions beneficiary.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ type Beneficiary struct {
}

// NewBeneficiary returns a new Beneficiary
func NewBeneficiary() Beneficiary {
b := Beneficiary{
func NewBeneficiary() *Beneficiary {
b := &Beneficiary{
tag: TagBeneficiary,
}
return b
Expand Down
4 changes: 2 additions & 2 deletions beneficiaryCustomer.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ type BeneficiaryCustomer struct {
}

// NewBeneficiaryCustomer returns a new BeneficiaryCustomer
func NewBeneficiaryCustomer() BeneficiaryCustomer {
bc := BeneficiaryCustomer{
func NewBeneficiaryCustomer() *BeneficiaryCustomer {
bc := &BeneficiaryCustomer{
tag: TagBeneficiaryCustomer,
}
return bc
Expand Down
14 changes: 14 additions & 0 deletions beneficiaryCustomer_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package wire

// mockBeneficiaryCustomer creates a BeneficiaryCustomer
func mockBeneficiaryCustomer() *BeneficiaryCustomer {
bc := NewBeneficiaryCustomer()
bc.CoverPayment.SwiftFieldTag = ""
bc.CoverPayment.SwiftLineOne = ""
bc.CoverPayment.SwiftLineTwo = ""
bc.CoverPayment.SwiftLineThree= ""
bc.CoverPayment.SwiftLineFour = ""
bc.CoverPayment.SwiftLineFive = ""
bc.CoverPayment.SwiftLineSix = ""
return bc
}
4 changes: 2 additions & 2 deletions beneficiaryFI.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ type BeneficiaryFI struct {
}

// NewBeneficiaryFI returns a new BeneficiaryFI
func NewBeneficiaryFI() BeneficiaryFI {
bfi := BeneficiaryFI{
func NewBeneficiaryFI() *BeneficiaryFI {
bfi := &BeneficiaryFI{
tag: TagBeneficiaryFI,
}
return bfi
Expand Down
13 changes: 13 additions & 0 deletions beneficiaryFI_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package wire

// mockBeneficiaryFI creates a BeneficiaryFI
func mockBeneficiaryFI() *BeneficiaryFI {
bfi := NewBeneficiaryFI()
bfi.FinancialInstitution.IdentificationCode = DemandDepositAccountNumber
bfi.FinancialInstitution.Identifier = "123456789"
bfi.FinancialInstitution.Name = "FI Name"
bfi.FinancialInstitution.Address.AddressLineOne = "Address One"
bfi.FinancialInstitution.Address.AddressLineTwo = "Address Two"
bfi.FinancialInstitution.Address.AddressLineThree = "Address Three"
return bfi
}
4 changes: 2 additions & 2 deletions beneficiaryIntermediaryFI.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ type BeneficiaryIntermediaryFI struct {
}

// NewBeneficiaryIntermediaryFI returns a new BeneficiaryIntermediaryFI
func NewBeneficiaryIntermediaryFI() BeneficiaryIntermediaryFI {
bifi := BeneficiaryIntermediaryFI{
func NewBeneficiaryIntermediaryFI() *BeneficiaryIntermediaryFI {
bifi := &BeneficiaryIntermediaryFI{
tag: TagBeneficiaryIntermediaryFI,
}
return bifi
Expand Down
13 changes: 13 additions & 0 deletions beneficiaryIntermediaryFI_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package wire

// mockBeneficiaryIntermediaryFI creates a BeneficiaryIntermediaryFI
func mockBeneficiaryIntermediaryFI() *BeneficiaryIntermediaryFI {
bifi := NewBeneficiaryIntermediaryFI()
bifi.FinancialInstitution.IdentificationCode = DemandDepositAccountNumber
bifi.FinancialInstitution.Identifier = "123456789"
bifi.FinancialInstitution.Name = "FI Name"
bifi.FinancialInstitution.Address.AddressLineOne = "Address One"
bifi.FinancialInstitution.Address.AddressLineTwo = "Address Two"
bifi.FinancialInstitution.Address.AddressLineThree = "Address Three"
return bifi
}
4 changes: 2 additions & 2 deletions beneficiaryReference.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ type BeneficiaryReference struct {
}

// NewBeneficiaryReference returns a new BeneficiaryReference
func NewBeneficiaryReference() BeneficiaryReference {
br := BeneficiaryReference{
func NewBeneficiaryReference() *BeneficiaryReference {
br := &BeneficiaryReference{
tag: TagBeneficiaryReference,
}
return br
Expand Down
8 changes: 8 additions & 0 deletions beneficiaryReference_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package wire

// mockBeneficiaryReference creates a BeneficiaryReference
func mockBeneficiaryReference() *BeneficiaryReference {
br:= NewBeneficiaryReference()
br.BeneficiaryReference = "Reference"
return br
}
13 changes: 13 additions & 0 deletions beneficiary_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package wire

// mockBeneficiary creates a Beneficiary
func mockBeneficiary() *Beneficiary {
b := NewBeneficiary()
b.Personal.IdentificationCode = DriversLicenseNumber
b.Personal.Identifier = "1234"
b.Personal.Name = "Name"
b.Personal.Address.AddressLineOne = "Address One"
b.Personal.Address.AddressLineTwo = "Address Two"
b.Personal.Address.AddressLineThree = "Address Three"
return b
}
4 changes: 2 additions & 2 deletions businessFunctionCode.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ type BusinessFunctionCode struct {
}

// NewBusinessFunctionCode returns a new BusinessFunctionCode
func NewBusinessFunctionCode() BusinessFunctionCode {
bfc := BusinessFunctionCode{
func NewBusinessFunctionCode() *BusinessFunctionCode {
bfc := &BusinessFunctionCode{
tag: TagBusinessFunctionCode,
}
return bfc
Expand Down
9 changes: 9 additions & 0 deletions businessFunctionCode_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package wire

// mockBusinessFunctionCode creates a BusinessFunctionCode
func mockBusinessFunctionCode() *BusinessFunctionCode {
bfc := NewBusinessFunctionCode()
bfc.BusinessFunctionCode = "BankTransfer"
bfc.TransactionTypeCode = ""
return bfc
}
4 changes: 2 additions & 2 deletions inputMessageAccountabilityData.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ type InputMessageAccountabilityData struct {
}

// NewInputMessageAccountabilityData returns a new InputMessageAccountabilityData
func NewInputMessageAccountabilityData() InputMessageAccountabilityData {
imad := InputMessageAccountabilityData{
func NewInputMessageAccountabilityData() *InputMessageAccountabilityData {
imad := &InputMessageAccountabilityData{
tag: TagInputMessageAccountabilityData,
}
return imad
Expand Down
10 changes: 10 additions & 0 deletions inputMessageAccountabilityData_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package wire

// mockInputMessageAccountabilityData creates a mockInputMessageAccountabilityData
func mockInputMessageAccountabilityData() *InputMessageAccountabilityData {
imad := NewInputMessageAccountabilityData()
imad.InputCycleDate = "20190410"
imad.InputSource = "Source"
imad.InputSequenceNumber = "000001"
return imad
}
4 changes: 2 additions & 2 deletions instructingFI.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ type InstructingFI struct {
}

// NewInstructingFI returns a new InstructingFI
func NewInstructingFI() InstructingFI {
ifi := InstructingFI{
func NewInstructingFI() *InstructingFI {
ifi := &InstructingFI{
tag: TagInstructingFI,
}
return ifi
Expand Down
13 changes: 13 additions & 0 deletions instructingFI_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package wire

// mockInstructingFI creates a InstructingFI
func mockInstructingFI() *InstructingFI {
ifi := NewInstructingFI()
ifi.FinancialInstitution.IdentificationCode = DemandDepositAccountNumber
ifi.FinancialInstitution.Identifier = "123456789"
ifi.FinancialInstitution.Name = "FI Name"
ifi.FinancialInstitution.Address.AddressLineOne = "Address One"
ifi.FinancialInstitution.Address.AddressLineTwo = "Address Two"
ifi.FinancialInstitution.Address.AddressLineThree = "Address Three"
return ifi
}
4 changes: 2 additions & 2 deletions originator.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ type Originator struct {
}

// NewOriginator returns a new Originator
func NewOriginator() Originator {
o := Originator{
func NewOriginator() *Originator {
o := &Originator{
tag: TagOriginator,
}
return o
Expand Down
4 changes: 2 additions & 2 deletions originatorFI.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ type OriginatorFI struct {
}

// NewOriginatorFI returns a new OriginatorFI
func NewOriginatorFI() OriginatorFI {
ofi := OriginatorFI{
func NewOriginatorFI() *OriginatorFI {
ofi := &OriginatorFI{
tag: TagOriginatorFI,
}
return ofi
Expand Down
13 changes: 13 additions & 0 deletions originatorFI_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package wire

// mockOriginatorFI creates a OriginatorFI
func mockOriginatorFI() *OriginatorFI {
ofi := NewOriginatorFI()
ofi.FinancialInstitution.IdentificationCode = PassportNumber
ofi.FinancialInstitution.Identifier = "123456789"
ofi.FinancialInstitution.Name = "FI Name"
ofi.FinancialInstitution.Address.AddressLineOne = "Address One"
ofi.FinancialInstitution.Address.AddressLineTwo = "Address Two"
ofi.FinancialInstitution.Address.AddressLineThree = "Address Three"
return ofi
}
5 changes: 3 additions & 2 deletions originatorOptionF.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ type OriginatorOptionF struct {
}

// NewOriginatorOptionF returns a new OriginatorOptionF
func NewOriginatorOptionF() OriginatorOptionF {
oof := OriginatorOptionF{
func NewOriginatorOptionF() *OriginatorOptionF {
oof := &OriginatorOptionF{
tag: TagOriginatorOptionF,
}
return oof
Expand Down Expand Up @@ -120,6 +120,7 @@ func (oof *OriginatorOptionF) Validate() error {
if err := oof.fieldInclusion(); err != nil {
return err
}
// ToDo; PartyIdentifier Validation
if err := oof.isAlphanumeric(oof.Name); err != nil {
return fieldError("Name", err, oof.Name)
}
Expand Down
12 changes: 12 additions & 0 deletions originatorOptionF_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package wire

// mockOriginatorOptionF creates a OriginatorOptionF
func mockOriginatorOptionF() *OriginatorOptionF {
oof := NewOriginatorOptionF()
oof.PartyIdentifier = "TXID/123-45-6789"
oof.Name = "Name"
oof.LineOne = "LineOne"
oof.LineTwo = "LineTwo"
oof.LineThree = "LineThree"
return oof
}
4 changes: 2 additions & 2 deletions originatorToBeneficiary.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ type OriginatorToBeneficiary struct {
}

// NewOriginatorToBeneficiary returns a new OriginatorToBeneficiary
func NewOriginatorToBeneficiary() OriginatorToBeneficiary {
ob := OriginatorToBeneficiary{
func NewOriginatorToBeneficiary() *OriginatorToBeneficiary {
ob := &OriginatorToBeneficiary{
tag: TagOriginatorToBeneficiary,
}
return ob
Expand Down
11 changes: 11 additions & 0 deletions originatorToBeneficiary_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package wire

// mockOriginatorToBeneficiary creates a OriginatorToBeneficiary
func mockOriginatorToBeneficiary() *OriginatorToBeneficiary {
ob := NewOriginatorToBeneficiary()
ob.LineOne = "LineOne"
ob.LineTwo = "LineTwo"
ob.LineThree = "LineThree"
ob.LineFour = "LineFour"
return ob
}
13 changes: 13 additions & 0 deletions originator_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package wire

// mockOriginator creates a Originator
func mockOriginator() *Originator {
o := NewOriginator()
o.Personal.IdentificationCode = PassportNumber
o.Personal.Identifier = "1234"
o.Personal.Name = "Name"
o.Personal.Address.AddressLineOne = "Address One"
o.Personal.Address.AddressLineTwo = "Address Two"
o.Personal.Address.AddressLineThree = "Address Three"
return o
}
4 changes: 2 additions & 2 deletions receiverDepositoryInstitution.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ type ReceiverDepositoryInstitution struct {
}

// NewReceiverDepositoryInstitution returns a new ReceiverDepositoryInstitution
func NewReceiverDepositoryInstitution() ReceiverDepositoryInstitution {
rdi := ReceiverDepositoryInstitution{
func NewReceiverDepositoryInstitution() *ReceiverDepositoryInstitution {
rdi := &ReceiverDepositoryInstitution{
tag: TagReceiverDepositoryInstitution,
}
return rdi
Expand Down
9 changes: 9 additions & 0 deletions receiverDepositoryInstitution_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package wire

// mockReceiverDepositoryInstitution creates a ReceiverDepositoryInstitution
func mockReceiverDepositoryInstitution() *ReceiverDepositoryInstitution {
rdi := NewReceiverDepositoryInstitution()
rdi.ReceiverABANumber = "231380104"
rdi.ReceiverShortName = "Citadel"
return rdi
}
Loading

0 comments on commit 9210de1

Please sign in to comment.