owl-blogs/test/mock_entry.go

45 lines
905 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
2023-08-08 17:41:07 +00:00
Title string
2023-06-25 18:04:06 +00:00
}
2024-02-14 20:05:50 +00:00
// Form implements model.EntryMetaData.
func (*MockEntryMetaData) Form(binSvc model.BinaryStorageInterface) string {
panic("unimplemented")
}
// ParseFormData implements model.EntryMetaData.
2024-02-21 19:24:18 +00:00
func (*MockEntryMetaData) ParseFormData(data model.HttpFormData, binSvc model.BinaryStorageInterface) error {
2024-02-14 20:05:50 +00:00
panic("unimplemented")
}
2023-06-25 18:04:06 +00:00
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() model.EntryMetaData {
2023-06-25 18:04:06 +00:00
return e.metaData
}
func (e *MockEntry) SetMetaData(metaData model.EntryMetaData) {
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 {
2023-08-08 17:41:07 +00:00
return e.metaData.Title
2023-07-09 18:36:35 +00:00
}