Skip to content

Commit a321a70

Browse files
committed
Refactor: Rename test functions for clarity and consistency
1 parent 1bde990 commit a321a70

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

controllers/baseHandler_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
"github.com/stretchr/testify/assert"
1111
)
1212

13-
func TestHomeHandler(t *testing.T) {
13+
func TestDiscordBaseHandler(t *testing.T) {
1414
t.Run("Should return 400 when request body is empty", func(t *testing.T) {
1515
w := httptest.NewRecorder()
1616
r, _ := http.NewRequest("POST", "/", http.NoBody)

service/discordBaseService_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import (
1515
"github.com/stretchr/testify/assert"
1616
)
1717

18-
func TestHomeHandler(t *testing.T) {
18+
func TestDiscordBaseHandler(t *testing.T) {
1919
t.Run("Should return 400 when request body is empty", func(t *testing.T) {
2020
w := httptest.NewRecorder()
2121
r, _ := http.NewRequest("POST", "/", http.NoBody)

service/helloService_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import (
1515
"github.com/stretchr/testify/assert"
1616
)
1717

18-
func TestHelloService(t *testing.T) {
18+
func TestHello(t *testing.T) {
1919

2020
t.Run("should return a success response with a message", func(t *testing.T) {
2121
w := httptest.NewRecorder()

service/main_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import (
1616
)
1717

1818
func TestMainService(t *testing.T) {
19-
t.Run("should return HelloService when command name is hello", func(t *testing.T) {
19+
t.Run("should return Hello when command name is hello", func(t *testing.T) {
2020
CS := CommandService{discordMessage: fixtures.HelloCommand}
2121
w := httptest.NewRecorder()
2222
r, _ := http.NewRequest("GET", "/", nil)

0 commit comments

Comments
 (0)