mock

package
v0.0.0-...-f0644f1 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2018 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AnalyzeJobSource

type AnalyzeJobSource struct {
	NextJobFn        func() (*job.Chat, error)
	NextJobFnInvoked bool

	QueueJobFn        func(*job.Chat) error
	QueueJobFnInvoked bool
	// contains filtered or unexported fields
}

Poller represents a mock implementation of report.Poller

func (*AnalyzeJobSource) NextJob

func (js *AnalyzeJobSource) NextJob() (*job.Chat, error)

Poll implements the Poll method of our mock Poller

func (AnalyzeJobSource) QueueJob

func (js AnalyzeJobSource) QueueJob(analyzeJob *job.Chat) error

type ChatService

type ChatService struct {
	NewFn      func(ctx context.Context, r io.Reader, email string) error
	NewInvoked bool

	RetrieveFn      func(id string) (*chat.Chat, error)
	RetrieveInvoked bool
}

ChatService represents a mock of chat.ChatService

func (*ChatService) New

func (cs *ChatService) New(ctx context.Context, r io.Reader, email string) error

New invokes the mock implementation and marks the function as invoked

func (*ChatService) Retrieve

func (cs *ChatService) Retrieve(id string) (*chat.Chat, error)

Retrieve invokes the mock implementation and marks the function as invoked

type Notifier

type Notifier struct {
	NotifyFn func(message string, email string) error
}

func (*Notifier) Notify

func (n *Notifier) Notify(message string, email string) error

type ReportService

type ReportService struct {
	GetFunc        func(ctx context.Context, id string) (*report.Report, error)
	GetFuncInvoked bool

	NewFunc        func(*report.Report) error
	NewFuncInvoked bool
}

ReportService represents a mock of report.ReportService

func (*ReportService) Get

func (rs *ReportService) Get(ctx context.Context, id string) (*report.Report, error)

Get invokes the mock implementation and marks the function as invoked

func (*ReportService) New

func (rs *ReportService) New(r *report.Report) error

New invokes the mock implementation and marks the function as invoked

Jump to

Keyboard shortcuts

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