github.com/cloudreve/Cloudreve/v3@v3.0.0-20240224133659-3edb00a6484c/pkg/mocks/wopimock/mock.go (about) 1 package wopimock 2 3 import ( 4 model "github.com/cloudreve/Cloudreve/v3/models" 5 "github.com/cloudreve/Cloudreve/v3/pkg/wopi" 6 "github.com/stretchr/testify/mock" 7 ) 8 9 type WopiClientMock struct { 10 mock.Mock 11 } 12 13 func (w *WopiClientMock) NewSession(user uint, file *model.File, action wopi.ActonType) (*wopi.Session, error) { 14 args := w.Called(user, file, action) 15 return args.Get(0).(*wopi.Session), args.Error(1) 16 } 17 18 func (w *WopiClientMock) AvailableExts() []string { 19 args := w.Called() 20 return args.Get(0).([]string) 21 }