projectiontest

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockGuardedProjection

type MockGuardedProjection struct {
	*MockProjection
	projection.QueryGuard
}

MockGuardedProjection is a projection mock that embeds a projection.Guard.

func NewMockGuardedProjection

func NewMockGuardedProjection(guard projection.QueryGuard) *MockGuardedProjection

NewMockGuardedProjection returns a MockGuardedProjection.

type MockProgressor

type MockProgressor struct {
	*MockProjection
	*projection.Progressor
}

MockProgressor is a projection mock that embeds a *projection.Progressor.

func NewMockProgressor

func NewMockProgressor() *MockProgressor

NewMockProgressor returns a MockProgressor.

type MockProjection

type MockProjection struct {
	AppliedEvents []event.Event
}

MockProjection is a projection mock that's used for testing.

func NewMockProjection

func NewMockProjection() *MockProjection

NewMockProjection returns a MockProjection.

func (*MockProjection) ApplyEvent

func (proj *MockProjection) ApplyEvent(evt event.Event)

ApplyEvent adds evt as an applied event to the MockProjection.

func (*MockProjection) ExpectApplied

func (proj *MockProjection) ExpectApplied(t *testing.T, events ...event.Event)

ExpectApplied determines whether events were applied to the MockProjection and if not, makes the test fail.

func (*MockProjection) HasApplied

func (proj *MockProjection) HasApplied(events ...event.Event) bool

HasApplied determines whether the passed events have been applied to the MockProjection.

type MockResetProjection

type MockResetProjection struct {
	*MockProgressor

	Foo int
}

MockResetProjection is a projection mock that embeds a *projection.Progressor and has a Reset method.

func NewMockResetProjection

func NewMockResetProjection(val int) *MockResetProjection

NewMockResetProjection returns a MockResetProjection. The Foo field of the projection is set to val. When the Reset method of the projection is called, Foo is set to 0 to mock a reset of the projection.

func (*MockResetProjection) Reset

func (proj *MockResetProjection) Reset()

Reset resets the projection by clearing its applied events and setting the Foo field to 0.

Jump to

Keyboard shortcuts

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