1
0
mirror of https://github.com/jhillyerd/inbucket.git synced 2025-12-18 18:17:03 +00:00

Large refactor for #69

- makefile: Don't refresh deps automatically, causes double build
- storage: Move GetMessage, GetMessages (Mailbox), PurgeMessages to the
  Store API for #69
- storage: Remove Mailbox.Name method for #69
- test: Create new test package for #79
- test: Implement StoreStub, migrate some tests off MockDataStore for
  task #80
- rest & webui: update controllers to use new Store methods
This commit is contained in:
James Hillyerd
2018-03-10 18:50:18 -08:00
parent a58dfc5e4f
commit 9c18f1fb30
12 changed files with 160 additions and 227 deletions

View File

@@ -15,6 +15,24 @@ type MockDataStore struct {
mock.Mock
}
// GetMessage mock function
func (m *MockDataStore) GetMessage(name, id string) (Message, error) {
args := m.Called(name, id)
return args.Get(0).(Message), args.Error(1)
}
// GetMessages mock function
func (m *MockDataStore) GetMessages(name string) ([]Message, error) {
args := m.Called(name)
return args.Get(0).([]Message), args.Error(1)
}
// PurgeMessages mock function
func (m *MockDataStore) PurgeMessages(name string) error {
args := m.Called(name)
return args.Error(0)
}
// MailboxFor mock function
func (m *MockDataStore) MailboxFor(name string) (Mailbox, error) {
args := m.Called(name)
@@ -61,12 +79,6 @@ func (m *MockMailbox) NewMessage() (Message, error) {
return args.Get(0).(Message), args.Error(1)
}
// Name mock function
func (m *MockMailbox) Name() string {
args := m.Called()
return args.String(0)
}
// String mock function
func (m *MockMailbox) String() string {
args := m.Called()