Documentation ¶
Index ¶
- type Module
- type ModuleMock
- func (mock *ModuleMock) GetLoader(scriptMoqParam *script.Script) lua.LGFunction
- func (mock *ModuleMock) GetLoaderCalls() []struct{ ... }
- func (mock *ModuleMock) Name() string
- func (mock *ModuleMock) NameCalls() []struct{}
- func (mock *ModuleMock) Stop() error
- func (mock *ModuleMock) StopCalls() []struct{}
- type ModuleTest
- type ModuleTestMock
- func (mock *ModuleTestMock) Clean()
- func (mock *ModuleTestMock) CleanCalls() []struct{}
- func (mock *ModuleTestMock) GetLoader(scriptMoqParam *script.Script) lua.LGFunction
- func (mock *ModuleTestMock) GetLoaderCalls() []struct{ ... }
- func (mock *ModuleTestMock) Name() string
- func (mock *ModuleTestMock) NameCalls() []struct{}
- func (mock *ModuleTestMock) Result() ([]TestResult, error)
- func (mock *ModuleTestMock) ResultCalls() []struct{}
- type TestResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Module ¶
type Module interface { Name() string GetLoader(script *script.Script) lua.LGFunction Stop() error }
Module is an interface for core module
type ModuleMock ¶
type ModuleMock struct { // GetLoaderFunc mocks the GetLoader method. GetLoaderFunc func(scriptMoqParam *script.Script) lua.LGFunction // NameFunc mocks the Name method. NameFunc func() string // StopFunc mocks the Stop method. StopFunc func() error // contains filtered or unexported fields }
ModuleMock is a mock implementation of Module.
func TestSomethingThatUsesModule(t *testing.T) { // make and configure a mocked Module mockedModule := &ModuleMock{ GetLoaderFunc: func(scriptMoqParam *script.Script) lua.LGFunction { panic("mock out the GetLoader method") }, NameFunc: func() string { panic("mock out the Name method") }, StopFunc: func() error { panic("mock out the Stop method") }, } // use mockedModule in code that requires Module // and then make assertions. }
func (*ModuleMock) GetLoader ¶
func (mock *ModuleMock) GetLoader(scriptMoqParam *script.Script) lua.LGFunction
GetLoader calls GetLoaderFunc.
func (*ModuleMock) GetLoaderCalls ¶ added in v0.8.2
func (mock *ModuleMock) GetLoaderCalls() []struct { ScriptMoqParam *script.Script }
GetLoaderCalls gets all the calls that were made to GetLoader. Check the length with:
len(mockedModule.GetLoaderCalls())
func (*ModuleMock) NameCalls ¶ added in v0.8.2
func (mock *ModuleMock) NameCalls() []struct { }
NameCalls gets all the calls that were made to Name. Check the length with:
len(mockedModule.NameCalls())
func (*ModuleMock) StopCalls ¶ added in v0.8.2
func (mock *ModuleMock) StopCalls() []struct { }
StopCalls gets all the calls that were made to Stop. Check the length with:
len(mockedModule.StopCalls())
type ModuleTest ¶ added in v0.4.0
type ModuleTest interface { Name() string GetLoader(script *script.Script) lua.LGFunction Result() ([]TestResult, error) Clean() }
ModuleTest is an interface for core test module
type ModuleTestMock ¶ added in v0.8.2
type ModuleTestMock struct { // CleanFunc mocks the Clean method. CleanFunc func() // GetLoaderFunc mocks the GetLoader method. GetLoaderFunc func(scriptMoqParam *script.Script) lua.LGFunction // NameFunc mocks the Name method. NameFunc func() string // ResultFunc mocks the Result method. ResultFunc func() ([]TestResult, error) // contains filtered or unexported fields }
ModuleTestMock is a mock implementation of ModuleTest.
func TestSomethingThatUsesModuleTest(t *testing.T) { // make and configure a mocked ModuleTest mockedModuleTest := &ModuleTestMock{ CleanFunc: func() { panic("mock out the Clean method") }, GetLoaderFunc: func(scriptMoqParam *script.Script) lua.LGFunction { panic("mock out the GetLoader method") }, NameFunc: func() string { panic("mock out the Name method") }, ResultFunc: func() ([]TestResult, error) { panic("mock out the Result method") }, } // use mockedModuleTest in code that requires ModuleTest // and then make assertions. }
func (*ModuleTestMock) Clean ¶ added in v0.8.2
func (mock *ModuleTestMock) Clean()
Clean calls CleanFunc.
func (*ModuleTestMock) CleanCalls ¶ added in v0.8.2
func (mock *ModuleTestMock) CleanCalls() []struct { }
CleanCalls gets all the calls that were made to Clean. Check the length with:
len(mockedModuleTest.CleanCalls())
func (*ModuleTestMock) GetLoader ¶ added in v0.8.2
func (mock *ModuleTestMock) GetLoader(scriptMoqParam *script.Script) lua.LGFunction
GetLoader calls GetLoaderFunc.
func (*ModuleTestMock) GetLoaderCalls ¶ added in v0.8.2
func (mock *ModuleTestMock) GetLoaderCalls() []struct { ScriptMoqParam *script.Script }
GetLoaderCalls gets all the calls that were made to GetLoader. Check the length with:
len(mockedModuleTest.GetLoaderCalls())
func (*ModuleTestMock) Name ¶ added in v0.8.2
func (mock *ModuleTestMock) Name() string
Name calls NameFunc.
func (*ModuleTestMock) NameCalls ¶ added in v0.8.2
func (mock *ModuleTestMock) NameCalls() []struct { }
NameCalls gets all the calls that were made to Name. Check the length with:
len(mockedModuleTest.NameCalls())
func (*ModuleTestMock) Result ¶ added in v0.8.2
func (mock *ModuleTestMock) Result() ([]TestResult, error)
Result calls ResultFunc.
func (*ModuleTestMock) ResultCalls ¶ added in v0.8.2
func (mock *ModuleTestMock) ResultCalls() []struct { }
ResultCalls gets all the calls that were made to Result. Check the length with:
len(mockedModuleTest.ResultCalls())