testutils

package
v0.0.0-...-9c029b6 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2017 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Assert

func Assert(condition bool, t *testing.T, failMessage ...interface{})

func TestSettersAndGetters

func TestSettersAndGetters(object interface{}, t *testing.T) bool

Types

type MockCharacter

type MockCharacter struct {
	MockObject
	MockNameable
	MockContainer
}

func (*MockCharacter) GetHealth

func (*MockCharacter) GetHealth() int

func (*MockCharacter) GetHitPoints

func (*MockCharacter) GetHitPoints() int

func (*MockCharacter) GetWeight

func (*MockCharacter) GetWeight() int

func (*MockCharacter) Heal

func (*MockCharacter) Heal(int)

func (*MockCharacter) Hit

func (*MockCharacter) Hit(int)

func (*MockCharacter) SetHealth

func (*MockCharacter) SetHealth(int)

func (*MockCharacter) SetHitPoints

func (*MockCharacter) SetHitPoints(int)

type MockContainer

type MockContainer struct {
}

func (*MockContainer) AddCash

func (*MockContainer) AddCash(int)

func (*MockContainer) AddItem

func (*MockContainer) AddItem(types.Id)

func (*MockContainer) GetCapacity

func (*MockContainer) GetCapacity() int

func (*MockContainer) GetCash

func (*MockContainer) GetCash() int

func (*MockContainer) GetItems

func (*MockContainer) GetItems() types.ItemList

func (*MockContainer) RemoveCash

func (*MockContainer) RemoveCash(int)

func (*MockContainer) RemoveItem

func (*MockContainer) RemoveItem(types.Id) bool

func (*MockContainer) SetCapacity

func (*MockContainer) SetCapacity(int)

type MockDestroyable

type MockDestroyable struct {
}

func (MockDestroyable) Destroy

func (MockDestroyable) Destroy()

func (MockDestroyable) IsDestroyed

func (self MockDestroyable) IsDestroyed() bool

type MockId

type MockId string

func (MockId) Hex

func (self MockId) Hex() string

func (MockId) String

func (self MockId) String() string

type MockIdentifiable

type MockIdentifiable struct {
	Id types.Id
}

func (MockIdentifiable) GetId

func (self MockIdentifiable) GetId() types.Id

type MockNameable

type MockNameable struct {
	Name string
}

func (MockNameable) GetName

func (self MockNameable) GetName() string

func (*MockNameable) SetName

func (self *MockNameable) SetName(name string)

type MockObject

type MockObject struct {
	MockIdentifiable
	MockReadLocker
	MockDestroyable
}

func (MockObject) SetId

func (self MockObject) SetId(types.Id)

type MockPC

type MockPC struct {
	MockCharacter
	RoomId types.Id
}

func NewMockPC

func NewMockPC() *MockPC

func (MockPC) AddSkill

func (self MockPC) AddSkill(types.Id)

func (MockPC) GetRoomId

func (self MockPC) GetRoomId() types.Id

func (MockPC) GetSkills

func (self MockPC) GetSkills() []types.Id

func (MockPC) IsOnline

func (self MockPC) IsOnline() bool

func (MockPC) SetRoomId

func (self MockPC) SetRoomId(types.Id)

type MockReadLocker

type MockReadLocker struct {
}

func (*MockReadLocker) ReadLock

func (*MockReadLocker) ReadLock()

func (*MockReadLocker) ReadUnlock

func (*MockReadLocker) ReadUnlock()

type MockRoom

type MockRoom struct {
	MockIdentifiable
}

func NewMockRoom

func NewMockRoom() *MockRoom

type MockUser

type MockUser struct {
	MockIdentifiable
}

func NewMockUser

func NewMockUser() *MockUser

type MockZone

type MockZone struct {
	MockIdentifiable
}

func NewMockZone

func NewMockZone() *MockZone

type TestCommunicable

type TestCommunicable struct {
	TestReadWriter
}

func (*TestCommunicable) GetInput

func (self *TestCommunicable) GetInput(prompt string) string

func (*TestCommunicable) GetWindowSize

func (self *TestCommunicable) GetWindowSize() (int, int)

func (*TestCommunicable) Write

func (self *TestCommunicable) Write(text string)

func (*TestCommunicable) WriteLine

func (self *TestCommunicable) WriteLine(line string, a ...interface{})

type TestReadWriter

type TestReadWriter struct {
	TestReader
	TestWriter
}

type TestReader

type TestReader struct {
	ToRead string
	// contains filtered or unexported fields
}

func (*TestReader) Read

func (self *TestReader) Read(p []byte) (n int, err error)

func (*TestReader) SetError

func (self *TestReader) SetError(err error)

type TestWriter

type TestWriter struct {
	Wrote string
}

func (*TestWriter) Write

func (self *TestWriter) Write(p []byte) (n int, err error)

Jump to

Keyboard shortcuts

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