test

package
v0.0.0-...-3f9ec74 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 20, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertError

func AssertError(t *testing.T, err error, errType interface{})

AssertError Valida a existência de erros internos

func AssertProcessBoletoFailed

func AssertProcessBoletoFailed(t *testing.T, response models.BoletoResponse)

AssertProcessBoletoFailed Valida se o houve um erro no processamento do boleto

func AssertProcessBoletoWithSuccess

func AssertProcessBoletoWithSuccess(t *testing.T, response models.BoletoResponse)

AssertProcessBoletoWithSuccess Valida se o boleto foi gerado com sucesso

func CreateClientIP

func CreateClientIP(c *gin.Context)

CreateClientIP cria IP no contexto

func ExpectError

func ExpectError(e error, t *testing.T)

ExpectError falha o teste se e == nil

func ExpectFalse

func ExpectFalse(condition bool, t *testing.T)

ExpectFalse falha o teste caso a condição não seja falsa

func ExpectNil

func ExpectNil(obj interface{}, t *testing.T)

ExpectNil falha o teste caso obj seja diferente de nil

func ExpectNoError

func ExpectNoError(e error, t *testing.T)

ExpectNoError falha o teste se e != nil

func ExpectTrue

func ExpectTrue(condition bool, t *testing.T)

ExpectTrue falha o teste caso a condição não seja verdadeira

func GetNode

func GetNode(bodyXml string, tagName string) string

func WalkThroughXml

func WalkThroughXml(nodes []XmlNode, f func(XmlNode) bool)

Types

type BuilderBoletoRequest

type BuilderBoletoRequest struct {
	PayeeGuarantor *models.PayeeGuarantor
	// contains filtered or unexported fields
}

func NewBuilderBoletoRequest

func NewBuilderBoletoRequest() BuilderBoletoRequest

func (*BuilderBoletoRequest) BoletoRequest

func (b *BuilderBoletoRequest) BoletoRequest() *models.BoletoRequest

func (*BuilderBoletoRequest) SetAgreement

func (b *BuilderBoletoRequest) SetAgreement(agreement models.Agreement)

func (*BuilderBoletoRequest) SetAuthentication

func (b *BuilderBoletoRequest) SetAuthentication(authentication models.Authentication)

func (*BuilderBoletoRequest) SetBank

func (b *BuilderBoletoRequest) SetBank(bank models.BankNumber)

func (*BuilderBoletoRequest) SetBuyer

func (b *BuilderBoletoRequest) SetBuyer(buyer models.Buyer)

func (*BuilderBoletoRequest) SetPayeeGuarantor

func (b *BuilderBoletoRequest) SetPayeeGuarantor(PayeeGuarantor *models.PayeeGuarantor)

func (*BuilderBoletoRequest) SetRecipient

func (b *BuilderBoletoRequest) SetRecipient(recipient models.Recipient)

func (*BuilderBoletoRequest) SetTitle

func (b *BuilderBoletoRequest) SetTitle(title models.Title)

type Parameter

type Parameter struct {
	Line     int
	Input    interface{}
	Expected interface{}
	Length   int
}

Parameter Parâmetro de teste com input generico

type StubBoletoRequest

type StubBoletoRequest struct {
	BuilderBoletoRequest
	Authentication models.Authentication
	Agreement      models.Agreement
	Title          models.Title
	Recipient      models.Recipient
	PayeeGuarantor *models.PayeeGuarantor
	Buyer          models.Buyer
	// contains filtered or unexported fields
}

StubBoletoRequest Stub base para criação de BoletoRequest

func NewStubBoletoRequest

func NewStubBoletoRequest(bank models.BankNumber) *StubBoletoRequest

func (*StubBoletoRequest) Build

func (*StubBoletoRequest) WithAcceptDivergentAmount

func (s *StubBoletoRequest) WithAcceptDivergentAmount(accepted bool) *StubBoletoRequest

func (*StubBoletoRequest) WithAgreementAccount

func (s *StubBoletoRequest) WithAgreementAccount(account string) *StubBoletoRequest

func (*StubBoletoRequest) WithAgreementAgency

func (s *StubBoletoRequest) WithAgreementAgency(agency string) *StubBoletoRequest

func (*StubBoletoRequest) WithAgreementNumber

func (s *StubBoletoRequest) WithAgreementNumber(number uint) *StubBoletoRequest

func (*StubBoletoRequest) WithAmountInCents

func (s *StubBoletoRequest) WithAmountInCents(amount uint64) *StubBoletoRequest

func (*StubBoletoRequest) WithAuthentication

func (s *StubBoletoRequest) WithAuthentication(authentication models.Authentication) *StubBoletoRequest

func (*StubBoletoRequest) WithBoletoType

func (s *StubBoletoRequest) WithBoletoType(title models.Title) *StubBoletoRequest

func (*StubBoletoRequest) WithBuyerName

func (s *StubBoletoRequest) WithBuyerName(buyerName string) *StubBoletoRequest

func (*StubBoletoRequest) WithBuyerZipCode

func (s *StubBoletoRequest) WithBuyerZipCode(zipcode string) *StubBoletoRequest

func (*StubBoletoRequest) WithDocumentNumber

func (s *StubBoletoRequest) WithDocumentNumber(documentNumber string) *StubBoletoRequest

func (*StubBoletoRequest) WithExpirationDate

func (s *StubBoletoRequest) WithExpirationDate(expiredAt time.Time) *StubBoletoRequest

func (*StubBoletoRequest) WithFine

func (s *StubBoletoRequest) WithFine(daysAfterExpirationDate uint, amountInCents uint64, percentageOnTotal float64) *StubBoletoRequest

func (*StubBoletoRequest) WithInstructions

func (s *StubBoletoRequest) WithInstructions(instructions string) *StubBoletoRequest

func (*StubBoletoRequest) WithInterest

func (s *StubBoletoRequest) WithInterest(daysAfterExpirationDate uint, amountPerDayInCents uint64, percentagePerMonth float64) *StubBoletoRequest

func (*StubBoletoRequest) WithMaxDaysToPayPastDue

func (s *StubBoletoRequest) WithMaxDaysToPayPastDue(days uint) *StubBoletoRequest

func (*StubBoletoRequest) WithOurNumber

func (s *StubBoletoRequest) WithOurNumber(ourNumber uint) *StubBoletoRequest

func (*StubBoletoRequest) WithPayeeGuarantorDocumentNumber

func (s *StubBoletoRequest) WithPayeeGuarantorDocumentNumber(docNumber string) *StubBoletoRequest

func (*StubBoletoRequest) WithPayeeGuarantorDocumentType

func (s *StubBoletoRequest) WithPayeeGuarantorDocumentType(documentType string) *StubBoletoRequest

func (*StubBoletoRequest) WithPayeeGuarantorName

func (s *StubBoletoRequest) WithPayeeGuarantorName(PayeeGuarantorName string) *StubBoletoRequest

func (*StubBoletoRequest) WithRecipientDocumentNumber

func (s *StubBoletoRequest) WithRecipientDocumentNumber(docNumber string) *StubBoletoRequest

func (*StubBoletoRequest) WithRecipientDocumentType

func (s *StubBoletoRequest) WithRecipientDocumentType(documentType string) *StubBoletoRequest

func (*StubBoletoRequest) WithRecipientName

func (s *StubBoletoRequest) WithRecipientName(recipientName string) *StubBoletoRequest

func (*StubBoletoRequest) WithWallet

func (s *StubBoletoRequest) WithWallet(wallet uint16) *StubBoletoRequest

type UInt64TestParameter

type UInt64TestParameter struct {
	Input    uint64
	Expected string
}

UInt64TestParameter Parâmetro de teste com input do tipo uint64

type XmlNode

type XmlNode struct {
	XMLName xml.Name
	Content []byte    `xml:",innerxml"`
	Nodes   []XmlNode `xml:",any"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL