summaryrefslogtreecommitdiff
path: root/internal/user
diff options
context:
space:
mode:
Diffstat (limited to 'internal/user')
-rw-r--r--internal/user/mock_test.go2
-rw-r--r--internal/user/service_test.go12
2 files changed, 7 insertions, 7 deletions
diff --git a/internal/user/mock_test.go b/internal/user/mock_test.go
index 0f0f672..caea4da 100644
--- a/internal/user/mock_test.go
+++ b/internal/user/mock_test.go
@@ -5,7 +5,7 @@ type RepositoryMock struct {
err error
}
-func getEmptyRepository() *RepositoryMock {
+func newEmptyRepository() *RepositoryMock {
return &RepositoryMock{users: []User{}, err: nil}
}
diff --git a/internal/user/service_test.go b/internal/user/service_test.go
index 16353d2..8c724ff 100644
--- a/internal/user/service_test.go
+++ b/internal/user/service_test.go
@@ -14,9 +14,9 @@ func TestMain(m *testing.M) {
os.Exit(m.Run())
}
-func NewTestUserService(t *testing.T) *Service {
+func newTestUserService(t *testing.T) *Service {
t.Helper()
- return &Service{repository: getEmptyRepository(), bcryptCost: bcrypt.MinCost}
+ return &Service{repository: newEmptyRepository(), bcryptCost: bcrypt.MinCost}
}
func TestRegisterInputValidateFaultyData(t *testing.T) {
@@ -37,7 +37,7 @@ func TestRegisterInputValidateFaultyData(t *testing.T) {
func TestRegisterBadInput(t *testing.T) {
in := &RegisterInput{}
- s := NewTestUserService(t)
+ s := newTestUserService(t)
_, err := s.Register(in)
if err == nil {
t.Error("no error when registering with faulty input")
@@ -45,7 +45,7 @@ func TestRegisterBadInput(t *testing.T) {
}
func TestRegisterExistingUser(t *testing.T) {
- r := getEmptyRepository()
+ r := newEmptyRepository()
r.fill()
badInputs := map[string]RegisterInput{
@@ -97,7 +97,7 @@ func TestRegisterRepositoryError(t *testing.T) {
}
func TestSuccessfulRegister(t *testing.T) {
- s := NewTestUserService(t)
+ s := newTestUserService(t)
in := &RegisterInput{
Username: "happyuser123",
Email: "happyuser@email.com",
@@ -116,7 +116,7 @@ func TestSuccessfulRegister(t *testing.T) {
}
func TestRegisterSameUserTwice(t *testing.T) {
- s := NewTestUserService(t)
+ s := newTestUserService(t)
in := &RegisterInput{
Username: "happyuser123",
Email: "happyuser@email.com",