1
0
mirror of https://github.com/muety/wakapi.git synced 2023-08-10 21:12:56 +03:00

test: add essential unit tests for core functionality (resolve #6)

This commit is contained in:
Ferdinand Mütsch
2020-11-14 12:30:45 +01:00
parent e806e5455e
commit f4328c452f
8 changed files with 382 additions and 6 deletions

15
mocks/alias_repository.go Normal file
View File

@@ -0,0 +1,15 @@
package mocks
import (
"github.com/muety/wakapi/models"
"github.com/stretchr/testify/mock"
)
type AliasRepositoryMock struct {
mock.Mock
}
func (m *AliasRepositoryMock) GetByUser(s string) ([]*models.Alias, error) {
args := m.Called(s)
return args.Get(0).([]*models.Alias), args.Error(1)
}