all repos

onasty @ 5003a09

a one-time notes service

onasty/e2e/mailer_mock_test.go (view raw)

Smirnov Oleksandr Smirnov Oleksandr
ss2316544@gmail.com
feat: reset password (#110)..., 1 year ago
1
package e2e_test
2
3
import (
4
	"context"
5
6
	"github.com/olexsmir/onasty/internal/events/mailermq"
7
)
8
9
var _ mailermq.Mailer = (*mailerMockService)(nil)
10
11
var mockMailStore = make(map[string]string)
12
13
type mailerMockService struct{}
14
15
func newMailerMockService() *mailerMockService {
16
	return &mailerMockService{}
17
}
18
19
func (m *mailerMockService) SendVerificationEmail(
20
	_ context.Context,
21
	i mailermq.SendVerificationEmailRequest,
22
) error {
23
	mockMailStore[i.Receiver] = i.Token
24
	return nil
25
}
26
27
func (m *mailerMockService) SendPasswordResetEmail(
28
	_ context.Context,
29
	i mailermq.SendPasswordResetEmailRequest,
30
) error {
31
	mockMailStore[i.Receiver] = i.Token
32
	return nil
33
}