1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- package mockapp
- import (
- "context"
- "sync"
- "wartank/pkg/mock/mockkernel"
- "wartank/pkg/types"
- )
- type MockApp struct {
- *mockkernel.MockKernel
- fnCancel func()
- ctx context.Context
- bot types.IWarBot
- store types.IStore
- block *sync.RWMutex
- ServWeb_ types.IServWeb
- }
- func NewMockApp() *MockApp {
- ctxBg := context.Background()
- ctx, fnCancel := context.WithCancel(ctxBg)
- sf := &MockApp{
- MockKernel: mockkernel.NewMockKernel(),
- ctx: ctx,
- fnCancel: fnCancel,
- block: &sync.RWMutex{},
- }
- return sf
- }
- func (sf *MockApp) Store() types.IStore {
- return sf.store
- }
- func (sf *MockApp) Bot() types.IWarBot {
- return sf.bot
- }
- func (sf *MockApp) Angar() types.IAngar {
- return nil
- }
- func (sf *MockApp) CtxApp() context.Context {
- return sf.ctx
- }
- func (sf *MockApp) GuiWeb() types.IGuiWeb {
- return nil
- }
- func (sf *MockApp) Tank() types.ITank {
- return nil
- }
- func (sf *MockApp) Run() error {
- return nil
- }
- func (sf *MockApp) CancelApp() {
- go sf.fnCancel()
- }
- func (sf *MockApp) Block() *sync.RWMutex {
- return sf.block
- }
- func (sf *MockApp) NetClient() types.IBotNet {
- return nil
- }
- func (sf *MockApp) ServWeb() types.IServWeb {
- return sf.ServWeb_
- }
- func (sf *MockApp) ServBots() types.IServBots {
- return nil
- }
|