mock

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SurveysMock

type SurveysMock struct {
	MockMakeRequestFn              func(ctx context.Context, payload surveys.RequestHelperPayload) (*http.Response, error)
	MockListSurveyFormsFn          func(ctx context.Context, projectID int) ([]*domain.SurveyForm, error)
	MockGetSurveyFormFn            func(ctx context.Context, projectID int, formID string) (*domain.SurveyForm, error)
	MockGeneratePublicAccessLinkFn func(ctx context.Context, input dto.SurveyLinkInput) (*dto.SurveyPublicLink, error)
	MockGetSubmissionsFn           func(ctx context.Context, input dto.VerifySurveySubmissionInput) ([]domain.Submission, error)
	MockDeletePublicAccessLinkFn   func(ctx context.Context, input dto.VerifySurveySubmissionInput) error
	MockListSubmittersFn           func(ctx context.Context, projectID int, formID string) ([]domain.Submitter, error)
	MockListPublicAccessLinksFn    func(ctx context.Context, projectID int, formID string) ([]*dto.SurveyPublicLink, error)
	MockGetFormXMLFn               func(ctx context.Context, projectID int, formID, version string) (map[string]interface{}, error)
	MockGetSubmissionXMLFn         func(ctx context.Context, projectID int, formID, instanceID string) (map[string]interface{}, error)
}

SurveysMock mocks the surveys service

func NewSurveysMock

func NewSurveysMock() *SurveysMock

NewSurveysMock initializes the surveys mock service

func (s *SurveysMock) DeletePublicAccessLink(ctx context.Context, input dto.VerifySurveySubmissionInput) error

DeletePublicAccessLink mocks the implementation of deleting the public access link for the given survey

func (s *SurveysMock) GeneratePublicAccessLink(ctx context.Context, input dto.SurveyLinkInput) (*dto.SurveyPublicLink, error)

GeneratePublicAccessLink generates a public access link for the given survey

func (*SurveysMock) GetFormXML

func (s *SurveysMock) GetFormXML(ctx context.Context, projectID int, formID, version string) (map[string]interface{}, error)

GetFormXML retrieves a form's XML definition

func (*SurveysMock) GetSubmissionXML

func (s *SurveysMock) GetSubmissionXML(ctx context.Context, projectID int, formID, instanceID string) (map[string]interface{}, error)

GetSubmissionXML retrieves a submission's XML definition using the instance id

func (*SurveysMock) GetSubmissions

func (s *SurveysMock) GetSubmissions(ctx context.Context, input dto.VerifySurveySubmissionInput) ([]domain.Submission, error)

GetSubmissions mocks the action of getting the submissions for the given survey

func (*SurveysMock) GetSurveyForm

func (s *SurveysMock) GetSurveyForm(ctx context.Context, projectID int, formID string) (*domain.SurveyForm, error)

GetSurveyForm gets the survey form for the given project and form ID

func (s *SurveysMock) ListPublicAccessLinks(ctx context.Context, projectID int, formID string) ([]*dto.SurveyPublicLink, error)

ListPublicAccessLinks returns a list of all public access links created for a particular form

func (*SurveysMock) ListSubmitters

func (s *SurveysMock) ListSubmitters(ctx context.Context, projectID int, formID string) ([]domain.Submitter, error)

ListSubmitters mocks the action of listing all the submitters of a given survey

func (*SurveysMock) ListSurveyForms

func (s *SurveysMock) ListSurveyForms(ctx context.Context, projectID int) ([]*domain.SurveyForm, error)

ListSurveyForms lists the survey forms for the given project

func (*SurveysMock) MakeRequest

func (s *SurveysMock) MakeRequest(ctx context.Context, payload surveys.RequestHelperPayload) (*http.Response, error)

MakeRequest makes a request to the surveys service

Jump to

Keyboard shortcuts

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