package mock import "git.runcible.io/learning/ratchet/internal/model" var MockEmail = "drew@fake.com" var MockPassword = "thisisinsecure" type UserService struct{} func (u *UserService) Insert(name, email, password string) (int, error) { switch email { case "dupe@example.com": return 0, model.ErrDuplicateEmail default: return 1, nil } } func (u *UserService) Authenticate(email, password string) (int, error) { if email == MockEmail && password == MockPassword { return 1, nil } return 0, model.ErrInvalidCredentials } func (u *UserService) Exists(id int) (bool, error) { switch id { case 1: return true, nil default: return false, nil } }