examination

package
v0.0.0-...-e0c9873 Latest Latest
Warning

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

Go to latest
Published: May 7, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package examination is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Examination

type Examination struct {
	// contains filtered or unexported fields
}

func NewExamination

func NewExamination(userId uuid.UUID, examType ExaminationType, examDate types.Date, score Score) Examination

func NewExaminationWithID

func NewExaminationWithID(id, userId uuid.UUID, examType ExaminationType, examDate types.Date, score Score) Examination

func (Examination) Date

func (e Examination) Date() types.Date

func (Examination) ID

func (e Examination) ID() uuid.UUID

func (Examination) Score

func (e Examination) Score() Score

func (Examination) Type

func (e Examination) Type() ExaminationType

type ExaminationList

type ExaminationList []Examination

type ExaminationType

type ExaminationType int
const (
	ExaminationTypeEnglish ExaminationType = iota
	ExaminationTypeMath
)

type MockRepository

type MockRepository struct {
	// contains filtered or unexported fields
}

MockRepository is a mock of Repository interface.

func NewMockRepository

func NewMockRepository(ctrl *gomock.Controller) *MockRepository

NewMockRepository creates a new mock instance.

func (*MockRepository) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockRepository) GetAll

func (m *MockRepository) GetAll(ctx context.Context, userId uuid.UUID) (ExaminationList, error)

GetAll mocks base method.

func (*MockRepository) Save

func (m *MockRepository) Save(ctx context.Context, exam Examination) error

Save mocks base method.

type MockRepositoryMockRecorder

type MockRepositoryMockRecorder struct {
	// contains filtered or unexported fields
}

MockRepositoryMockRecorder is the mock recorder for MockRepository.

func (*MockRepositoryMockRecorder) GetAll

func (mr *MockRepositoryMockRecorder) GetAll(ctx, userId interface{}) *gomock.Call

GetAll indicates an expected call of GetAll.

func (*MockRepositoryMockRecorder) Save

func (mr *MockRepositoryMockRecorder) Save(ctx, exam interface{}) *gomock.Call

Save indicates an expected call of Save.

type Repository

type Repository interface {
	GetAll(ctx context.Context, userId uuid.UUID) (ExaminationList, error)
	Save(ctx context.Context, exam Examination) error
}

type RepositoryMock

type RepositoryMock struct {
	// GetAllFunc mocks the GetAll method.
	GetAllFunc func(ctx context.Context, userId uuid.UUID) (ExaminationList, error)

	// SaveFunc mocks the Save method.
	SaveFunc func(ctx context.Context, exam Examination) error
	// contains filtered or unexported fields
}

RepositoryMock is a mock implementation of Repository.

func TestSomethingThatUsesRepository(t *testing.T) {

	// make and configure a mocked Repository
	mockedRepository := &RepositoryMock{
		GetAllFunc: func(ctx context.Context, userId uuid.UUID) (ExaminationList, error) {
			panic("mock out the GetAll method")
		},
		SaveFunc: func(ctx context.Context, exam Examination) error {
			panic("mock out the Save method")
		},
	}

	// use mockedRepository in code that requires Repository
	// and then make assertions.

}

func (*RepositoryMock) GetAll

func (mock *RepositoryMock) GetAll(ctx context.Context, userId uuid.UUID) (ExaminationList, error)

GetAll calls GetAllFunc.

func (*RepositoryMock) GetAllCalls

func (mock *RepositoryMock) GetAllCalls() []struct {
	Ctx    context.Context
	UserId uuid.UUID
}

GetAllCalls gets all the calls that were made to GetAll. Check the length with:

len(mockedRepository.GetAllCalls())

func (*RepositoryMock) Save

func (mock *RepositoryMock) Save(ctx context.Context, exam Examination) error

Save calls SaveFunc.

func (*RepositoryMock) SaveCalls

func (mock *RepositoryMock) SaveCalls() []struct {
	Ctx  context.Context
	Exam Examination
}

SaveCalls gets all the calls that were made to Save. Check the length with:

len(mockedRepository.SaveCalls())

type Score

type Score int

func NewScore

func NewScore(score int) (Score, error)

func (Score) Int

func (s Score) Int() int

Jump to

Keyboard shortcuts

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