owl-blogs/test/mock_entry.go

34 lines
530 B
Go
Raw Normal View History

2023-06-25 18:04:06 +00:00
package test
import (
"owl-blogs/domain/model"
"time"
)
type MockEntryMetaData struct {
Str string
Number int
Date time.Time
}
type MockEntry struct {
2023-07-08 13:56:42 +00:00
model.EntryBase
metaData *MockEntryMetaData
2023-06-25 18:04:06 +00:00
}
func (e *MockEntry) Content() model.EntryContent {
2023-07-06 16:56:43 +00:00
return model.EntryContent(e.metaData.Str)
2023-06-25 18:04:06 +00:00
}
func (e *MockEntry) MetaData() interface{} {
return e.metaData
}
2023-07-08 13:56:42 +00:00
func (e *MockEntry) SetMetaData(metaData interface{}) {
2023-06-25 18:04:06 +00:00
e.metaData = metaData.(*MockEntryMetaData)
}
2023-07-09 18:36:35 +00:00
func (e *MockEntry) Title() string {
return ""
}