You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
599 B

package svc
type mockProgram struct {
start func() error
stop func() error
init func(Environment) error
}
func (p *mockProgram) Start() error {
return p.start()
}
func (p *mockProgram) Stop() error {
return p.stop()
}
func (p *mockProgram) Init(wse Environment) error {
return p.init(wse)
}
func makeProgram(startCalled, stopCalled, initCalled *int) *mockProgram {
return &mockProgram{
start: func() error {
*startCalled++
return nil
},
stop: func() error {
*stopCalled++
return nil
},
init: func(wse Environment) error {
*initCalled++
return nil
},
}
}