coretest

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MockCommand added in v0.0.4

func MockCommand(setup func(m *coremocks.Command)) *coremocks.Command

func MockEntity added in v0.0.4

func MockEntity(setup func(m *coremocks.Entity)) *coremocks.Entity

func MockEvent added in v0.0.4

func MockEvent(setup func(m *coremocks.Event)) *coremocks.Event

func MockReply added in v0.0.4

func MockReply(setup func(m *coremocks.Reply)) *coremocks.Reply

Types

type Command added in v0.0.4

type Command struct{ Value string }

func (Command) CommandName added in v0.0.4

func (Command) CommandName() string

type Entity added in v0.0.4

type Entity struct {
	core.EntityBase
	Value string
}

func (Entity) EntityName added in v0.0.4

func (Entity) EntityName() string

func (Entity) Events added in v0.0.4

func (Entity) Events() []core.Event

func (Entity) ID added in v0.0.4

func (Entity) ID() string

type Event added in v0.0.4

type Event struct{ Value string }

func (Event) EventName added in v0.0.4

func (Event) EventName() string

type Reply added in v0.0.4

type Reply struct{ Value string }

func (Reply) ReplyName added in v0.0.4

func (Reply) ReplyName() string

type TestMarshaller

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

TestMarshaller returns a Marshaller for testing purposes

JSON encoding is used for the Marshal and Unmarshal methods.

The registered types may be reset using Reset() at any time while testing.

func NewTestMarshaller

func NewTestMarshaller() *TestMarshaller

NewTestMarshaller constructs a new TestMarshaller

func (*TestMarshaller) GetType

func (m *TestMarshaller) GetType(typeName string) reflect.Type

GetType returns the reflect.Type if it has been registered

func (*TestMarshaller) Marshal

func (*TestMarshaller) Marshal(v interface{}) ([]byte, error)

Marshal returns v in byte form

func (*TestMarshaller) RegisterType

func (m *TestMarshaller) RegisterType(typeName string, v reflect.Type)

RegisterType registers a new reflect.Type for the given name key

func (*TestMarshaller) Reset

func (m *TestMarshaller) Reset()

Reset will remove all previously registered types

func (*TestMarshaller) Unmarshal

func (*TestMarshaller) Unmarshal(data []byte, v interface{}) error

Unmarshal returns the bytes marshalled into v

type UnregisteredCommand added in v0.0.4

type UnregisteredCommand struct{ Value string }

func (UnregisteredCommand) CommandName added in v0.0.4

func (UnregisteredCommand) CommandName() string

type UnregisteredEvent added in v0.0.4

type UnregisteredEvent struct{ Value string }

func (UnregisteredEvent) EventName added in v0.0.4

func (UnregisteredEvent) EventName() string

type UnregisteredReply added in v0.0.4

type UnregisteredReply struct{ Value string }

func (UnregisteredReply) ReplyName added in v0.0.4

func (UnregisteredReply) ReplyName() string

Jump to

Keyboard shortcuts

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